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.

To start cleanup actions from the MCP panel, use the RC row command from one of the following lists:
  • Ended-in-error-list
  • Operation list when you modify an operation
  • Operation list when you rerun an occurrence
  • Dependency status change list
In each case, the OPERATION RESTART AND CLEANUP main menu is displayed. You can choose a step-level restart, job restart, a cleanup without restart, or cleanup results for a specific operation.

The operator can reject the deletion if it is not appropriate in the context of the job stream to be restarted.

Accessing the restart and cleanup data sets, the controller reads the historical data set information and decides the required cleanup actions depending on the step range. Consider this example of the events for restart and cleanup:
⋮
//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
This is the sequence of events for restart and cleanup:
  1. The job fails at step S6.
  2. From the error list, you restart the job from step S5.
  3. The scheduler does not take any cleanup actions, because steps S3 and S4 are outside the scope of the restart.
  4. The job fails again.
  5. You restart it from step S2.
  6. 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.
  7. The scheduler catalogs the data set that was uncataloged in step S4. This does not happen for release 2.3 or earlier of scheduler.