Job and step-level cleanup
With step-level cleanup, you can perform cleanup actions for a range of steps. On the other hand, job-level cleanup is for all steps up to the last step executed.
Cleanup logic selects all data sets eligible for deletion depending on the range of selected steps and the options specified in the RCLOPTS initialization statement.
Cleanup marks all data sets that are defined with DISP=NEW as eligible for potential deletion. If they belong to flushed steps, or are referenced in previous steps with a disposition of OLD, SHR, or MOD, then they are not marked for action.
- Ended-in-error-list
- Operation list when you modify an operation
- Operation list when you rerun an occurrence
- Dependency status change list
The operator can reject the deletion if it is not appropriate in the context of the job stream to be restarted.
⋮
//S1 EXEC PGM=P1
//S2 EXEC PGM=P2
//S3 EXEC PGM=P3
//DD1 DD DSN=TEST.FILE.ONE,DISP=(NEW,CATLG,DELETE),
//VOL=SER=TSOL05,SPACE=(TRK,(1,1)),UNIT=3390,
//DCB=(BLKSIZE=3120,LRECL=80,RECFM=FB)
//S4 EXEC PGM=P4
//DD1 DD DSN=TEST.FILE.TWO,DISP=(SHR,UNCATLG)
//S5 EXEC PGM=P5
//S6 EXEC PGM=P6
//S7 EXEC PGM=P7
//S8 EXEC PGM=P8
- The job fails at step S6.
- From the error list, you restart the job from step S5.
- The scheduler does not take any cleanup actions, because steps S3 and S4 are outside the scope of the restart.
- The job fails again.
- You restart it from step S2.
- The scheduler now deletes the data set that was created in the first run in step S3. This does not happen for release 2.1 or earlier of the scheduler.
- The scheduler catalogs the data set that was uncataloged in step S4. This does not happen for release 2.3 or earlier of scheduler.