Passing Variables Using DGADGSUB
You can use the DGADGSUB program, which substitutes variables in the parameter list and then calls the DGADTSUB program to process the parameter list further.
To do this, modify an existing RUN TASK statement that calls DGADTSUB to call DGADGSUB, and add the variables you want to use in the parameter list.
The following figure is an example of RUN TASK using the DGADGSUB program.
|
In this example, the following circumstances are in effect:
- The ‘FROM' data set in the last COPY step before this RUN TASK is DALLAS1.FILE
- The ‘TO' data set in the last COPY step before this RUN TASK is DALLAS1.TEST.GDG.G0006V00
- The name of the Process is 'TESTPR'
- The Process number is 29
- The &JOBNAME is XYZ
The DGADGSUB program makes the variable substitutions and calls the DGADTSUB program with the following parameters:
|
Wherever &JOB, &SRC, &DST, &PROCNAME, &PROCNUM, and &DSN are found in DALLAS1.ZOS.SRCLIB(JCLTEST1), the corresponding values are substituted. Once all the substitutions have been made, the resultant JCL is submitted to JES.