Use the DDNAME parameter in cataloged procedures to postpone defining an in-stream data set until a job step calls the procedure. JES3 procedures cannot contain DD statements that define in-stream data sets and cannot contain in-stream data.
Use the DDNAME parameter in a job step that calls a procedure to postpone defining in-stream data until the last overriding DD statement for a procedure step. Overriding DD statements must appear in the same order as the DD statements in the procedure and any in-stream data sets must appear last in a calling step.
//XYZ DD DDNAME=PHOB
.
.
.
//PHOB DD DSNAME=NIN,DISP=(NEW,KEEP),UNIT=3400-5
From DD statement XYZ, the system saves XYZ and, temporarily, PHOB. Until the system encounters the ddname PHOB, it treats the data set for XYZ as a dummy data set.
//XYZ DD DSNAME=NIN,DISP=(NEW,KEEP),UNIT=3400-5
//DD1 DD DDNAME=LATER
.
.
.
//LATER DD DSN=SET12,DISP=(NEW,KEEP),UNIT=3390,
// VOLUME=SER=46231,SPACE=(TRK,(20,5))
.
.
.
//DD12 DD DSN=SET13,DISP=(NEW,KEEP),VOLUME=REF=*.DD1,
// SPACE=(TRK,(40,5))
DD1 postpones defining the data set until the system encounters DD statement LATER. DD12 must do a backward reference to DD1 because the system associates the data set information with the DD statement that contains the DDNAME parameter.
//DDA DD DDNAME=DEF
// DD DSN=A.B.C,DISP=OLD
// DD DSN=SEVC,DISP=OLD,UNIT=3390,VOL=SER=52226
.
.
.
//DEF DD *
data
/*
This example shows correct concatenation when a DDNAME parameter is coded.