ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

Alert Processing to resubmit job after failure.

book

Article ID: 195167

calendar_today

Updated On:

Products

ESP Workload Automation

Issue/Introduction

We need to have a setup in place when a Windows/Mainframe job fails it should get automatically resubmitted 5 times. If it fails for the 5th time it should send email to support team.

1st - 5th Instance of Failure --- Job should be restarted automatically

5th Instance of Failure --- Send email



Cause

Need automated resubmission of failed job.

Environment

Release : 11.4

Component : CA ESP WORKLOAD AUTOMATION

Resolution

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.

JOB DEFINITION:

JOB RCBJOBA                                 
   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(X120M)  REPLACE 
INVOKE 'USER.ESP.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]