Search code examples
parametersmainframejcl

How to expand job parameters and write it to a dataset using EZACFSM1 or any other way?


I want to expand the parameters supplied in a job and write it to a dataset. Tried using EZACFSM1 utility to do this but the params don't seem to expand. The code I tried is:

Proc:

   //STEP0100 EXEC PGM=EZACFSM1                                         
   //SYSOUT    DD SYSOUT=name_of_dataset                                     
   //SYSIN     DD *
   $EXP IS BLABLA
   /*

The value (say for example 'FOUR') for $EXP is passed in the job.

Expected output: Out Dataset containing the following:

FOUR IS BLABLA

Actual output: Out Dataset containing the following:

$EXP IS BLABLA

Solution

  • As noted in a comment, EZACFSM1 is for substituting system symbols. For the symbols you're talking about you need a different method.

    You could write your own program in your preferred language that accepts parameters and writes them to a dataset. It's trivial, and many shops already have such a utility. Ask your coworkers.

    If your shop licenses either DFSORT or Syncsort, you could use its JPn feature to write up to 10 symbols to a dataset.