IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Coding COND parm


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rocky_balboa

New User


Joined: 24 Mar 2010
Posts: 61
Location: Cape of Good Hope

PostPosted: Wed Aug 28, 2013 9:22 am
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 28, 2013 11:38 am
Reply with quote

COND= works only on OR conditions when a combination is specified
Back to top
View user's profile Send private message
rocky_balboa

New User


Joined: 24 Mar 2010
Posts: 61
Location: Cape of Good Hope

PostPosted: Wed Aug 28, 2013 11:49 am
Reply with quote

Thanks expat. I had this in my mind but could not get a confirmation from the manuals. Will need to redesign !!!
Back to top
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Wed Aug 28, 2013 4:50 pm
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu Aug 29, 2013 9:03 am
Reply with quote

Why the aversion to IF/THEN/ELSE? Many manuals recommend it over the older and oftentimes misread COND parameter.
Back to top
View user's profile Send private message
Scott Lippincott

New User


Joined: 07 May 2010
Posts: 2
Location: Philadelphia, PA

PostPosted: Thu Sep 19, 2013 10:15 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Sep 20, 2013 12:17 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts JCL EXEC PARM data in C Java & MQSeries 2
No new posts Need to specify PARM='POSIX(ON) Java & MQSeries 4
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts Reference for COND parameter. JCL & VSAM 1
Search our Forums:

Back to Top