IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

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: 197
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: 8793
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: 19251
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 All times are GMT + 6 Hours
Forum Index -> JCL & VSAM
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Cond parameter JCL & VSAM 10
No new posts JCL COND CODE check JCL & VSAM 5
No new posts query to fetch record which has only ... DB2 12
No new posts how to DYNAMICALLY write sort cond to... COBOL Programming 13
No new posts COND parameter vs IF THEN ELSE JCL & VSAM 11

Back to Top