We have a need to automatically resubmit, when a Windows/Mainframe job fails. If it fails above the number required it should send email to support team.
EXAMPLE:
1st - 5th Instance of Failure --- Job should be restarted automatically
5th Instance of Failure --- Send email
Release : 12.0
Component : ESP WORKLOAD AUTOMATION
Within the scope of a job you can use IF logic that will check the Submission number(ESPAPSUB#) of a job. If the first submission is less than or equal to 5, and the job
abends/fails, it will issue a NOTIFY firing an alert call RSUB. RSUB will trigger an event ESP.ALERT12. Event will invoke a procedure to resubmit the job up to 5 times.
If the submission number is greater than 5 it will use a different NOTIFY sending an email to a MAILBOX that has been setup as USER01. You can add an Alert here if you need to invoke a procedure to open a problem ticket.
Example:
JOB MYJOB
RUN DAILY
IF ESPAPSUB# LE 5 THEN DO
NOTIFY ABEND FAILURE ALERT(RSUB)
ENDDO
IF ESPAPSUB# GT 5 THEN DO
NOTIFY RESUB MAILBOX(USER01)
ENDDO
CCCHK RC(5:4095) FAIL CONTINUE
DELAYSUB 0800 EST
ENDJOB
ALERTDEF:
ALERT ID EVENT NAME
RSUB ESP.ALERT12
EVENT NAME:
EVENT ID(ESP.ALERT12) SYSTEM(ESPM) REPLACE
INVOKE 'HLQ.TESTPROC(ALERT12)'
ENDDEF
ALERT12 Procedure:
APPL ALERT12
JOB RESUB.JOB TASK PROCESS SELFCOMPLETING
RUN DAILY
IF MNSUB# LE 5 THEN -
ESPNOMSG AJ %MNJOB RESUB APPL(%MNAPPL..%MNAPPLGEN)
ENDJOB
MAILBOX:
MAILBOX USER01 MAXLINES(300)
EMAIL [email protected]