The VOLUME parameter (often abbreviated as VOL) identifies the volume or volumes on which a data set resides or should be created. It allows you to specify exact disk or tape volumes for data set allocation or retrieval, enabling precise control over data placement in the mainframe environment.
1//ddname DD VOLUME=SER=volser
Or using the abbreviated form:
1//ddname DD VOL=SER=volser
1//ddname DD VOLUME=(PRIVATE[,RETAIN][,seq][,volcount][,SER=(vol1,vol2,...)])
1//ddname DD VOLUME=REF=*.stepname.ddname
Or referencing a cataloged data set:
1//ddname DD VOLUME=REF=dataset.name
12//SPECDD DD DSN=USER.SPECIFIC.DATA,DISP=(NEW,CATLG,DELETE), // UNIT=SYSDA,SPACE=(CYL,(10,5)),VOL=SER=USR001
Creates a new data set on the volume with serial number USR001
123//MULTDD DD DSN=USER.LARGE.DATA,DISP=(NEW,CATLG,DELETE), // UNIT=(SYSDA,3),SPACE=(CYL,(50,10)), // VOL=SER=(VOL001,VOL002,VOL003)
Creates a data set that spans three volumes: VOL001, VOL002, and VOL003
1234//STEP1 EXEC PGM=IEFBR14 //INPUT DD DSN=USER.INPUT.DATA,DISP=SHR //OUTPUT DD DSN=USER.OUTPUT.DATA,DISP=(NEW,CATLG,DELETE), // UNIT=SYSDA,SPACE=(CYL,(10,5)),VOL=REF=*.INPUT
Creates a new data set on the same volume as USER.INPUT.DATA
12//REFDD DD DSN=USER.NEW.DATA,DISP=(NEW,CATLG,DELETE), // UNIT=SYSDA,SPACE=(TRK,(50,10)),VOL=REF=USER.CATALOG.DATA
Creates a new data set on the same volume as the cataloged data set USER.CATALOG.DATA
12//TAPESEQ DD DSN=USER.TAPE.FILE3,DISP=OLD, // UNIT=TAPE,VOL=(,,,3,SER=TAPE01)
Accesses the third data set on tape volume TAPE01
123//RETDD DD DSN=USER.IMPORTANT.DATA,DISP=(NEW,KEEP,DELETE), // UNIT=SYSDA,SPACE=(CYL,(5,1)), // VOL=(PRIVATE,RETAIN,SER=WORK02)
Creates a data set on a private volume that will remain mounted after the data set is closed
123//GROWDD DD DSN=USER.EXPANDING.DATA,DISP=(NEW,CATLG,DELETE), // UNIT=(SYSDA,5),SPACE=(CYL,(100,50)), // VOL=(,,,5,SER=DATA01)
Creates a data set that begins on DATA01 but can expand to use up to 5 volumes if needed