Symbolic Resolution Utilities (DGADTSUB and DGADGSUB)

The IBM® Connect:Direct® utility programs, DGADTSUB and DGADGSUB, enable you to submit jobs to the internal reader, much like RUN JOB. DGADTSUB has the added capability of symbolic resolution into the job. The RUN TASK statement invokes DGADTSUB or DGADGSUB, which allows you to substitute variables in the parameter list.

The following table lists DGADTSUB and DGADGSUB parameters, and DGADGSUB variables:

Parameter Description
JCL source The first parameter is an allocation string to point to the job to submit. Code it without a ddname because DGADTSUB acquires one. IBM Connect:Direct uses this value, along with the DISP parameter, to allocate the data set that contains the JCL.
Subsequent Parameters Subsequent parameters define resolutions for symbols used in the JCL itself. For each parameter, the first position is the name of the symbol found in the JCL and the second position is the value used. Separate the first and second positions by an equal sign (=), one or more spaces, or a comma. The value is terminated by the end of the parameter string, or a comma or space not within a quoted string. A parameter can also contain only a symbol name, in which case the value to substitute into the job stream is a null string.
Note: To pass lowercase data to the DGADTSUB program, use SYSOPTS in the RUN TASK statement.
Variables (for use with DGADGSUB) %SRCDSN          The resolved ‘FROM' data set name from the last COPY step executed in this Process

%DSTDSN          The resolved ‘TO' data set name from the last COPY step executed in this Process

%PROCNAME     The name of this Process

%PROCNUM       The number of this Process

Note: To use %SRCDSN or %DSTDSN, the RUN TASK must be run on the PNODE. The values for the %SRCDSN and %DSTDSN variables are not available when the RUN TASK is run on the SNODE.

The following figure is an example of RUN TASK using the DGADTSUB program.

RUN TASK  (PGM=DGADTSUB -
           PARM=('DSN=dsname,DISP=SHR', -
           'JOB X21JOB', -
           'RPTNAME REPORT01', -
           'CLASS A', -
           'FILE X21.FILE' -
            )) PNODE

The job stream source that corresponds to this RUN TASK statement is displayed in the following figure. The values requiring substitution are presented in bold type.

//&JOB JOB (79502),&RPTNAME,PRTY=12,TIME=(1),CLASS=&CLASS, 
// REGION=512K,MSGLEVEL=(1,1),MSGCLASS=X,NOTIFY=BSMITH1
//PRINT     EXEC PGM=IEBGENER
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD DUMMY,DCB=BLKSIZE=80
//SYSUT1    DD DISP=SHR,
//             DSN=&FILE 
//SYSUT2    DD SYSOUT=&CLASS,DCB=(&FILE) 

The following figure shows the resulting job stream after substitution has taken place. IBM Connect:Direct replaces the variables that began with & with the assigned values in the DGADTSUB parameter list.

//X21JOB JOB (79502),REPORT01,PRTY=12,TIME=(1),CLASS=A,
// REGION=512K,MSGLEVEL=(1,1),MSGCLASS=X,NOTIFY=BSMITH1
//PRINT      EXEC PGM=IEBGENER
//SYSPRINT   DD SYSOUT=*
//SYSIN      DD DUMMY,DCB=BLKSIZE=80
//SYSUT1     DD DISP=SHR,
//              DSN=X21.FILE
//SYSUT2     DD SYSOUT=A,DCB=(X21.FILE)
//*