Disposition
Disposition
Way to Go
Format of DISP Different parameter used Defaults used Examples
DISP
DISP is an operand of the DD statement DISP indicates what to do with the data set (the disposition) at step start, end, or abnormal end (if the job fails) DISP helps to prevent unwanted simultaneous access to data sets, which is very important for general system operation.
FORMAT
Status Normal
Disposition
Abnormal
Disposition
DISP=
Initial Status
NEW
Creation of new dataset (default)
OLD
Dataset exists and job step requires exclusive (unshared) use
SHR
Dataset exists and job step requests shared storage (Supported on DASD)
MOD
Sequential data set exists and is positioned at end of dataset Records added at the end (append) Exclusive usage
KEEP
Dataset is kept
PASS
Dataset is passed for use by a subsequent step within a job and catalog information is retained in memory
CATLG
Entry pointing to dataset in the system or user catalog created (Dataset kept)
UNCATLG
Entry pointing to dataset in the system or user catalog deleted
KEEP
Dataset to be kept
CATLG
Entry pointing to dataset in the system or user catalog created Dataset kept
UNCATLG
Entry pointing to dataset in the system or user catalog deleted Dataset kept
DISP defaults
Common DISP Coding
(no DISP) DISP = SHR DISP = OLD DISP=(NEW,PASS) DISP=(,CATLG) Is used for DISP=(NEW,DELETE,DELETE) DISP=(SHR,KEEP,KEEP) DISP=(OLD,KEEP,KEEP) DISP=(NEW,PASS,PASS) DISP=(NEW,CATLG,CATLG)
DISP=(,PASS)
DISP=(NEW,PASS,PASS)
Example 1
//STEP010 EXEC PGM=IEFBR14 //DD1 DD DSN=ABC,DISP=(SHR,KEEP) //DD2 DD DSN=SYSA,DISP=(OLD,DELETE,UNCATLG) //DD3 DD DSN=SYSB,UNIT=3350, // VOL=SER=335001,SPACE=(CYL,(4,2,1)), // DISP=(NEW,CATLG,KEEP) //DD4 DD DSN=&&SYS1,DISP=(MOD,PASS),UNIT=3350, // VOL=SER=335004,SPACE=(TRK,(15,5,1)) //STEP020 EXEC PGM=IEFBR14 //DD5 DD DSN=&&SYS1,DISP=(MOD,DELETE),UNIT=3350, // VOL=SER=335004,SPACE=(TRK,(15,5,1))
Example 2
To write a new member to PDS //STEP010 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSIN DD DUMMY //SYSUT1 DD DSN=NUSYJ51.PROJ.TMP1, // DISP=SHR //SYSUT2 DD DSN=NUSYJ51.PROJ.SOURCE(TMP1), // DISP=SHR
Example 3
//STEPA EXEC PGM=FILL //DD1 DD DSN=NUSYJ51.PROJ.TMP. UNIT=3353,VOLUME=SER=23562, SPACE=(TRK,(83,15)),DISP=(,PASS)
//STEPB EXEC PGM=CHAR //DD2 DD DSNAME=XTRA,DISP=OLD //DD3 DD DSN=*.STEPA.DD1,DISP=(OLD,PASS,DELETE)
Example 4
//STEP010 EXEC PGM=IEFBR14 //DEL1 DD DSN=NUSYJ51.PROJ.NEW, // DISP=(MOD,DELETE), // UNIT=SYSDA, // SPACE=(TRK,0)
Example 5
How to code STEPLIB for private load module library
References
Practical MVS JCL EXAMPLES James G. Janossy
MVS JCL Users Guide - By IBM
Thanks