Disposition processing of unreceived passed data sets

If a passed data set is never received by a later step, at the end of the job the system processes the data set as an unreceived, passed data set. This can result in unintentionally deleting the data set, even if it had been cataloged during the job, as the following example shows.

EXAMPLE:

Data set “dsname,” which does not exist at the start of a job but is created and cataloged during the job, will be uncataloged and deleted if it is passed and not received:
   //Step1  EXEC  PGM=pgmname1
   //DD1    DD    DSN=dsname,DISP=(NEW,CATLG,DELETE)
   //*
   //Step2  EXEC  PGM=pgmname2
   //DD2    DD    DSN=dsname,DISP=(OLD,PASS,DELETE)
   //*
   //Step3  EXEC  PGM=pgmname3
   //Step4  EXEC  PGM=pgmname4
   //DD4    DD    DSN=dsname,DISP=(OLD,PASS,DELETE)  

Data set “dsname” is cataloged when Step1 ends. After Step2 ends, “dsname” is still cataloged. If Step3 terminates abnormally, “dsname” will be deleted during end of job processing, because it had been passed by Step2 and not received by a following step, AND the abnormal disposition for Step2 was DELETE.

To avoid that situation, do not specify PASS for a cataloged data set—no matter whether it had been created in a prior job or in a prior step of this job. The correct JCL is:
   //Step1  EXEC  PGM=pgmname1
   //DD1    DD    DSN=dsname,DISP=(NEW,CATLG,DELETE)
   //*
   //Step2  EXEC  PGM=pgmname2
   //DD2    DD    DSN=dsname,DISP=(OLD,KEEP,DELETE)
   //*
   //Step3  EXEC  PGM=pgmname3
   //Step4  EXEC  PGM=pgmname4
   //DD4    DD    DSN=dsname,DISP=(OLD,KEEP,DELETE)