How to resubmit a job once, if it fails on a particular return code in a particular step after 5 minutes.

Document ID : KB000055335
Last Modified Date : 14/02/2018
Show Technical Document Details

For this example it is assumed the user wishes to resubmit Job A when it fails on a return code of 4 in step STEP02

  1. Update Job Tracking Definition Table (JTDT) so that Job A is tracked under its own model:

    TRACKDEF JOB NAME(A) MODEL(TEST)

  2. Create the tracking model:

    DEFTM TEST STEPFAILEVENT(CYBPROD.RESUB)

  3. Create the event CYBPROD.RESUB

    EVENT ID(CYBNR01.RESUB) SYSTEM(ESP) REPLACE INVOKE 'CYBPROD.PROCLIB(RESUB)' ENDDEF

  4. Create the procedure CYBPROD.PROCLIB(RESUB)
    TIME='REALNOW PLUS 5 MINUTES'IF %MNSTEP='STEP02' AND %MNMXRC='4' AND %MNRRJOB EQ '' THEN DOESPNOMSG AJ %MNJOB HOLD APPL(%MNAPPL..%MNAPPLGEN)ESPNOMSG AJ %MNJOB RESUBMIT APPL(%MNAPPL..%MNAPPLGEN)ESPNOMSG AJ %MNJOB RESET DELAYSUB('%TIME') APPL(%MNAPPL..%MNAPPLGEN)ESPNOMSG AJ %MNJOB RELEASE APPL(%MNAPPL..%MNAPPLGEN)ENDDO
    If the monitored job (A) gets a return code of 4 in step STEP02 and the job is not a rerun then the job will be held, resubmitted, have a delaysub of five minutes added to it and then will be released.

    This Frequently Asked Question applies to all supported releases of ESP Workload Manager beginning with 5.