What actions are taken for affected data sets?

Cleanup actions are designed to restore the catalog entries that were modified by the job to the state that they were in before the job started. Cleanup either deletes or uncatalogs data sets.

When the scheduler performs cleanup processing for a job, data sets and generation data groups (GDG) generations that have been created in that job are either deleted or uncataloged. Uncataloged data sets are cataloged. Cleanup actions for data set dispositions in a job describes the action that the scheduler takes for each data set disposition.

Table 1. Cleanup actions for data set dispositions in a job
DISP Reference to the data set Data Set Allocated and Cataloged at Job Start Reference to a Previous Step SMS in the Environment Protected by RCLOPTS Cleanup Actions
NEW, CATLG YES YES No impact No impact None
NO No impact YES None
NO DELETE
NO No impact No impact No impact None
NEW, KEEP YES YES No impact No impact None
NO No impact YES None
NO None or DELETE2
NO No impact No impact No impact None
OLD, UNCATLG YES No impact YES No impact None
NO YES None
NO CATALOG
NO No impact No impact No impact None
SHR, UNCATLG YES No impact YES No impact None
NO YES None
NO CATALOG
NO No impact No impact No impact None
MOD, CATLG YES YES No impact No impact None
NO YES YES None
NO None or DELETE1
NO YES None
NO Uncatalog
NO No impact No impact No impact None
MOD, UNCATLG YES No impact No impact YES None
NO CATALOG
NO No impact No impact No impact None
, , CATLG (abnormal step end) YES YES No impact No impact None
NO No impact YES None
NO DELETE
NO No impact No impact No impact None
, , UNCATLG (abnormal step end) YES YES No impact No impact None
NO No impact YES None
NO CATALOG
NO No impact No impact No impact None
1 The Cleanup action depends on the value specified in the SMSMODDELETE parameter in DSTOPTS:
None
If SMSMODDELTE(NO)
Delete
If SMSMODDELTE(YES)
2 The Cleanup action depends on where the data set is allocated:
None
If the data set is allocated on a tape
Delete
If the data set is allocated on a DASD

If you restart a job from a specified step, the scheduler does not try to restore a data set catalog status that was changed before the restart step.

For example, the job in Example of cleanup action for a job was tracked by the scheduler, failed at the third step 3, and had immediate cleanup defined. The cleanup actions are the following:
1
This data set would be uncataloged.
2
This data set would be cataloged.
3
This data set would be cataloged.
Figure 1. Example of cleanup action for a job
//STEP1 EXEC PGM=FIV
//DDX   DD DSNAME=IM.TEST.SHIP,DISP=(NEW,CATLG),UNIT=TAPE,         1
//         VOLUME=SER=T2,LABEL=(3,NSL),RETPD=188
//STEP2 EXEC PGM=EQQYCOM
//DDY   DD DSNAME=IM.TEST.PANELS,DISP=(OLD,UNCATLG),UNIT=3400,     2
//         VOLUME=SER=10222,LABEL=4
//STEP3 EXEC PGM=NOPGM
//DDZ   DD DSNAME=IM.TEST.HELP,DISP=(SHR,UNCATLG),UNIT=3400,       3
//         VOLUME=SER=10222,LABEL=4

Actions for data sets with DISP=NEW are not executed when they belong to flushed steps or when they were referenced in previous steps with DISP=SHR, OLD, or MOD, which are included in the new run range.