When VOLUME and UNIT are not coded

When you do not code VOLUME and UNIT on the DD statement, and the data set is not cataloged, you will receive a JCL error. If the data set is cataloged, and the problem program attempts to open the data set, you will receive a JCL error. If the data set is cataloged and the problem program does not attempt to open the data set, the disposition depends on the DISP normal termination disposition.
Example 1
//DISPJ JOB  158765,'SECT. 27'
//S1    EXEC PGM=IEFBR14
//D1    DD   DSN=ABC,DISP=(SHR,KEEP)
//D2    DD   DSN=SYSA,DISP=(OLD,DELETE,UNCATLG)
//D3    DD   DSN=SYSB,UNIT=3390,VOL=SER=335001,
//           SPACE=(CYL,(4,2,1)),DISP=(NEW,CATLG,KEEP)
//D4    DD   DSN=&&SYS1,DISP=(MOD,PASS),UNIT=3390,
//           VOL=SER=335004,SPACE=(TRK,(15,5,1))
//S2    EXEC PGM=IEFBR14
//D5    DD   DSN=&&SYS1,DISP=(MOD,DELETE),UNIT=3390,
//           VOL=SER=335004,SPACE=(TRK,(15,5,1))  
  1. D1 requests a data set that already exists and can be shared with other jobs. It is to be kept on the volume at the end of step S1.
  2. D2 requests a data set that already exists and cannot be shared with other jobs. It is to be deleted at the end of S1, but is to be kept and uncataloged if S1 abnormally terminates.
  3. D3 defines a new data set that is to be assigned to volume 335001 on a 3390 Direct Access Storage device. The data set is to be kept on the volume and cataloged if S1 terminates normally, but is to be kept and not cataloged if S1 terminates abnormally.
  4. D4 defines a temporary data set that is to be created in this job step. It is to be assigned to volume 335004 on a 3390 and allocated 15 primary tracks, five secondary tracks, and one directory record. This data set is to be passed for use in a later step in this job.
  5. D5 requests the temporary data set passed by D4 of S1. When S2 completes, the data set is to be deleted.
Example 2
//PASS JOB  ,'BILL H.'
//S1   EXEC PGM=IEFBR14
//DD1  DD   DSN=A,DISP=(NEW,PASS),VOL=SER=335000,
//          UNIT=3390,SPACE=(TRK,1)
//DD2  DD   DSN=A,DISP=(OLD,PASS),VOL=REF=*.DD1
//DD3  DD   DSN=B,DISP=(OLD,PASS),VOL=SER=335000,UNIT=3390
//DD4  DD   DSN=B,DISP=(OLD,PASS),VOL=SER=335001,UNIT=3390
//S2   EXEC PGM=IEFBR14
//DD5  DD   DSN=A,DISP=OLD
//DD6  DD   DSN=A,DISP=OLD
//DD7  DD   DSN=B,DISP=OLD
//DD8  DD   DSN=B,DISP=(OLD,PASS)
//S3   EXEC PGM=IEFBR14
//DD9  DD   DSN=B,DISP=OLD  
  1. DD1 and DD2 pass the same data set. DD5 and DD6 receive that same data set.
  2. DD3 and DD4 pass different data sets of the same name. DD7 receives the data set passed by DD3; DD8 receives the data set passed by DD4. DD8 continues to pass the data set originally passed by DD4.
  3. DD9 receives the data set passed by DD8.