Example 3

//AP301A66 JOB ....
//*%OPC RECOVER JOBCODE=NRC4,RESTART=N
//*%OPC RECOVER JOBCODE=(U046,S*37),ERRSTEP=STEP01,
//*%OPC   ADDPROC=(A66RECOV,SPACECHG)
//*%OPC RECOVER JOBCODE=S*37,ERRSTEP=STEP02,
//*%OPC   ADDAPPL=AP301ARA,RESSTEP=%
//*%OPC RECOVER ERRSTEP=STEP02
//STEP01 EXEC  PGM=SORT
//SYSOUT   DD  SYSOUT=A
//SORTIN   DD  DSN=AP301A.SALES.DATA,DISP=OLD,UNIT=3400-6,
//             LABEL=(1,SL)
//SORTOUT  DD  DSN=&&SORTOUT,DISP=(NEW,PASS),UNIT=SYSDA,
//             SPACE=(CYL,(5,1))
//SORTWK01 DD  UNIT=3380,SPACE=(CYL,(1,1))
//SORTWK02 DD  UNIT=3380,SPACE=(CYL,(1,1))
//SORTWK03 DD  UNIT=3380,SPACE=(CYL,(1,1))
//SYSIN    DD  *
  SORT FIELDS=(40,36,CH,A)
  RECORD TYPE=F,LENGTH=80
  END
//STEP02 EXEC PGM=REPORT
//SYSPRINT DD  SYSOUT=A
//REPORTIN DD  DSN=&&SORTOUT,DISP=(OLD,DELETE)
//XXXX     DD  DSN=&&XX,DISP=NEW,UNIT=SYSDA,SPACE=(CYL,(5,1))
In example 3:
  • The first RECOVER statement specifies that, for error code NRC4 (which is a case code set by the job completion checker), no recovery actions should be taken. Assume that NRC4 represents system completion codes such as 0C4 for which no automatic recovery should be done.
  • The second RECOVER statement specifies that, for space problems in step STEP01, JCL from the HCL Workload Automation for Z procedure library (which might be a copy of the RECOVER statements for step STEP02 and a space allocation step) should be included, and the failing job (HCL Workload Automation for Z operation) should be restarted from the beginning.
  • The third RECOVER statement specifies that, if there are space problems in step STEP02, a new application named AP301ARA is to be added, and the failing job (HCL Workload Automation for Z operation) must be restarted at step STEP02. The failing job will be a successor operation to AP301ARA and will be started when AP301ARA is completed.
  • The fourth RECOVER statement specifies that, for STEP02, all the remaining error codes not in the EXCLUDECC list should be restarted from the beginning without any JCL changes or other recovery actions.

If the error occurs outside the time range specified by the STARTTIME and ENDTIME parameters of the AROPTS automatic recovery initialization statement, the job remains in ended-in-error status.