Examples of DD statements and ddnames

Example 1
//MYDS   DD  DSNAME=REPORT
//A      DD  DSNAME=FILE
Example 2
//INPUT  DD  DSNAME=FGLIB,DISP=(OLD,PASS)
//       DD  DSNAME=GROUP2,DISP=SHR

In this example, because the ddname is missing from the second DD statement, the system concatenates the data sets defined in these statements.

Example 3
//PAYROLL.DAY DD  DSNAME=DESK,DISP=SHR

In this example, if procedure step PAYROLL contains a DD statement named DAY, this statement overrides parameters on DD statement DAY. If the step does not contain DD statement DAY, the system adds this statement to procedure step PAYROLL for the duration of the job step.

Example 4
//STEPSIX.DD4 DD  DSNAME=TEXT,DISP=(NEW,PASS)
//            DD  DSNAME=ART,DISP=SHR

In this example, the second data set is concatenated to the first, and both are added to procedure step STEPSIX. The ddname is omitted from the second DD statement in order to concatenate data set ART to data set TEXT.

Because the system does not allow you to write to a concatenation of data, you need another data set with DISP=OLD in order to read from TEXT. Write to the new DD name before reading from DD4.