When are cleanup actions performed?

If you specified RCLEANUP=YES in the OPCOPTS initialization statement, the scheduler performs cleanup actions depending on the cleanup option defined at operation level.

If you define an operation with the automatic cleanup option, cleanup actions can be started internally or from the panels. Usually, cleanup actions are executed as a first step at run time. If you define an operation with immediate cleanup type, the scheduler initiates the actions as soon as the job fails, with these exceptions:
  • The job fails with an error code that is set before, or during, job submission:
    • OSEQ
    • OSUB
    • OSUF
    • OSUP
    • OJCV
    • JCLI
    • LOOP
  • The job fails with one of these codes:
    • MCP
    • OSSQ
    • OSSS
    • OFSQ
    • OFSS
    • OFSC

    These error codes indicate that workload restart has failed, or that the operation has been manually set to error. The scheduler automatically changes the cleanup action from Immediate to Manual.

If you define an operation with the manual cleanup option, the scheduler starts cleanup actions only when you initiate it from Modify Current Plan. In any case, the cleanup process can be launched for a selected operation without restarting it (unless the cleanup option is set to none).

If both automatic recovery and cleanup actions are defined for an operation, the scheduler performs the cleanup actions first.