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

JCL Cond Codes


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

New User


Joined: 04 Jun 2013
Posts: 19
Location: India

PostPosted: Tue Sep 03, 2013 4:49 pm
Reply with quote

Hi,
I have the below requirement for a job with 3 steps wherein the 3rd step must be conditionally executed.

The condition is: Execute step3 if the RC from step1 and step2 is either 0 or 8. Skip if the RC is anyother value.

Is it possible to achieve this using COND parameter. Based on my understanding of COND parameter, i could not figure out how to code this.
I also considered using IF statement but could not figure out how to achieve this (as i understand 'IF' statement checks the highest.RC and not return code of every step).

Could any one help me with this.
Back to top
View user's profile Send private message
Vivek Anand

New User


Joined: 04 Jun 2013
Posts: 19
Location: India

PostPosted: Tue Sep 03, 2013 4:54 pm
Reply with quote

I realised that i have not described the requirement quite correctly. The number of steps in the job are not necessarily 3. It can be any number. My requirement is that the last step should execute only if the RC from all the previous steps are either RC1 or RC2. Hope i have described the requirement clearly.
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 199
Location: UK

PostPosted: Tue Sep 03, 2013 4:55 pm
Reply with quote

You can specify a stepname on your IF statement, e.g.;

// IF STEP010.RC EQ 1 THEN DO
Back to top
View user's profile Send private message
Vivek Anand

New User


Joined: 04 Jun 2013
Posts: 19
Location: India

PostPosted: Tue Sep 03, 2013 5:25 pm
Reply with quote

Hi David,
Thanks, the issue is that the number of steps in the job are not fixed. Kindly see my second post where i have clarified the requirement.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Sep 03, 2013 7:04 pm
Reply with quote

I would say that it is impossible using COND= processing
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: Tue Sep 03, 2013 7:34 pm
Reply with quote

Hello,

One way to accomplish what you want is to change the process to "record" the RC of each step in a file and then, in the last step, check to see if the run should end or not.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue Sep 03, 2013 7:46 pm
Reply with quote

I concur with Mr. Scherrer, although checking the accumulated completion codes in the penultimate step and returning a single CC to drive the processing thereafter might be clearer.
Back to top
View user's profile Send private message
Vivek Anand

New User


Joined: 04 Jun 2013
Posts: 19
Location: India

PostPosted: Wed Sep 04, 2013 1:03 pm
Reply with quote

Thank you all for your valuable inputs.
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 Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts AI writing DFSORT, REXX codes.. All Other Mainframe Topics 3
No new posts Reference for COND parameter. JCL & VSAM 1
No new posts IEF142I and Cond. Code 12 All Other Mainframe Topics 3
Search our Forums:

Back to Top