I have a JCL with 20 unique functionaliy steps. In this process if the job fails at any step (RC > 0, ABEND) the job should trigger an email stating what failed (user defined messages based on the step failure).
Sample JCL is given below.
IF SORT1 fails EMAIL1 should execute
IF STEP01 fails EMAIL2 should execute
Issue1: Some times I get RC>0 and ABEND. I want to handle both (can be same user defined message)
//EMAIL1 EXEC PGM=IEBGENER,COND=((0,GE,SORT1),ONLY)
The SORT1 step failed with RC=08 but the EMAIL1 is not getting executed but when ONLY is removed EMAIL1 is executed.
Issue2: If the sort step abends then both the steps Email1 and Email2 are getting excuted based on the cond parameter ONLY.
Joined: 22 Apr 2006 Posts: 6258 Location: Mumbai, India
Probably, you can set some specific RC for your sort step (check for NULLOUT) and check the value of it in subsequent steps instead of checking if it is greater than 0.
Suggest you use IF THEN ELSE construct of JCL to execute steps conditionally - IF construct also gives the facility of executing steps conditionally when there is an abend in one of the previous steps, please have a look on the manuals for details.
Joined: 01 Dec 2006 Posts: 710 Location: Pennsylvania
If it were me, I would be more worried about the proper flow of the Job from a functionality standpoint.
That is to say, if a step gave a bad cond code, which other steps need to be run/skipped.
As far as an email for each step failure,I think this that is a waste of time. I would check at the end of the job for any bad cc and send a single email. Let the persons receiving the email figure out which step was bad (how tough can it be).
I know what you are going to say 'each step has a different person responsibilty for that functionality'
Well then your issue is with your job creator, mixing so many different functions or your management for not having a central support team.