View previous topic :: View next topic
|
Author |
Message |
rocky_balboa
New User
Joined: 24 Mar 2010 Posts: 61 Location: Cape of Good Hope
|
|
|
|
Hello
I have following steps in JCL which are cobol DB2 programs. The first 4 programs can conditionally set a return code of 5. If any of the first 4 programs sets a RC of 5 then the fifth program should execute. The fifth program should not execute for any other return code.
Pseudo JCL
Step1 - COB prog1
Step2 - ABEND if prog1 has any other return code apart from 5
Step3 - COB prog2
Step4 - ABEND if prog2 has any other return code apart from 5
Step5 - COB prog3
Step6 - ABEND if prog3 has any other return code apart from 5
Step7 - COB prog4
Step8 - ABEND if prog4 has any other return code apart from 5
Step9 - COB prog5
Step10 - ABEND if prog5 has any other return code apart from 0
Tried every combination of COND parameter but no avail. How can this be achieved without using IF THEN/ELSE and using only COND parm? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
COND= works only on OR conditions when a combination is specified |
|
Back to top |
|
|
rocky_balboa
New User
Joined: 24 Mar 2010 Posts: 61 Location: Cape of Good Hope
|
|
|
|
Thanks expat. I had this in my mind but could not get a confirmation from the manuals. Will need to redesign !!! |
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Hi,
rocky_balboa wrote: |
Step1 - COB prog1
Step2 - ABEND if prog1 has any other return code apart from 5
|
Correct me if I am wrong here.
You want to check return code from Step1 and if its 5 then only continue to next step else Abend
I hope you have some mechanism or program for Abending the job at your shop
See if below code helps
Code: |
Step1 - COB prog1
Step2 - ABEND PROGRAM,COND=(5,EQ,STEP1) |
Here it will bypass Step2 only if Step1 returned code as 5
Regards,
Chandan |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Why the aversion to IF/THEN/ELSE? Many manuals recommend it over the older and oftentimes misread COND parameter. |
|
Back to top |
|
|
Scott Lippincott
New User
Joined: 07 May 2010 Posts: 2 Location: Philadelphia, PA
|
|
|
|
Hello,
I may be missing the point here, but if any of your steps (1,3,5,7) do not return a condition code of 5, the job will terminate in the following "ABEND" step. Nothing else will execute. By the time you get to step 9, ALL of the condition codes from steps 1,3,5,and 7 will have been 5. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
It appears our TS (Topic Starter) has floated away (happens all too often) with no followup.
Nope, i don't believe you're missing anything from what we have to work with.
Possibly TS will come back with an update. |
|
Back to top |
|
|
|