z/OS MVS JCL Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Referenced DD statement

z/OS MVS JCL Reference
SA23-1385-00

If the DDNAME parameter appears in a procedure with multiple steps, the ddname on the referenced DD statement takes the form stepname.ddname. For example, if procedure step STEPCP1 contains:
   //INDATA  DD  DDNAME=DD1
The referenced DD statement in the calling job step is:
   //STEPCP1.DD1  DD *

Parameters not permitted on the referenced DD statement: The referenced DD statement must not contain a DYNAM or PATH parameter.

A DD statement that contains a DDNAME parameter must not override a procedure sysout DD statement that contains an OUTPUT parameter if the referenced DD statement also contains an OUTPUT parameter.

References to Concatenated Data Sets: If you make a forward reference to a concatenation, the forward reference resolves to the first data set in the concatenation. If there are no DD statements between the forward reference and the concatenation, the rest of the data sets in the concatenation are appended to the first data set in the concatenation. The following example illustrates this.
//STEP1    EXEC PGM=IEBGENER
//SYSPRINT DD   SYSOUT=*
//SYSUT1   DD   DDNAME=INPUT
//INPUT    DD   DSN=TSTDATA1,DISP=SHR
//         DD   DSN=TSTDATA2,DISP=SHR
//SYSUT2   DD   SYSOUT=*
//SYSIN    DD   DUMMY

In this example, SYSUT1 will resolve to the first data set TSTDATA1, defined by the DDNAME forward reference INPUT. TSTDATA2, the second data set in the DDNAME forward reference INPUT, will be appended to SYSUT1 as well. IEBGENER will recognize TSTDATA1 and TSTDATA2 as input.

If there are any DD statements between the forward reference and the concatenation, the rest of the data sets in the concatenation are appended to the last DD statement preceding the concatenation. For example:
//STEP1    EXEC PGM=IEBGENER
//SYSUT1   DD   DDNAME=INPUT
//SYSPRINT DD   SYSOUT=*
//SYSUT2   DD   SYSOUT=*
//INPUT    DD   DSN=TSTDATA1,DISP=SHR
//         DD   DSN=TSTDATA2,DISP=SHR
//SYSIN    DD   DUMMY                  

In the preceding example, SYSUT1 will resolve to the first data set, TSTDATA1, defined in the DDNAME forward reference INPUT. TSTDATA2 will be appended to SYSUT2, the last DD statement preceding the concatenation. In that example IEBGENER will only recognize TSTDATA1 as input.

If a concatenated DD is added to a procedure, the remaining concatenated data sets will be concatenated to the last DD in the step named in an override or addition (or to the first step if no step was named in an override or addition). Note that this may result in these concatenated DDs being added to an unexpected DD. The following example illustrates this.
//TPROC    PROC
//S1       EXEC PGM=IEFBR14
//DD1      DD   DDNAME=INPUT
//DD2      DD   DSN=MYDSN2,DISP=SHR
//DD3      DD   DSN=MYDSN3,DISP=SHR
//S2       EXEC PGM=IEFBR14
//DDA      DD   DDNAME=INPUT
//DDB      DD   DSN=MINE2,DISP=SHR
//DDC      DD   DSN=MINE3,DISP=SHR
//         PEND
//STEP1    EXEC TPROC
//INPUT    DD   DSN=MYDSN1,DISP=SHR
//         DD   DSN=MYDSN4,DISP=SHR
//S2.INPUT DD   DSN=MINE1,DISP=SHR
//         DD   DSN=MINE4,DISP=SHR

 
In the preceding example, the result of the DDNAME forward reference INPUT is:
  • In step S1, DD1 resolves to data set MYDSN1 and data set MYDSN4 is concatenated to data set MYDSN3.
  • In step S2, DDA resolves to data set MINE1 and data set MINE4 is concatenated to data set MINE3.
Attention: The system always issues a warning message IEF694I, even if all data sets in the concatenation are used.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014