Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

JCL Cond Codes

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: JCL Cond Codes
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    Post subject: Reply to: JCL Cond Codes
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: 175
Location: UK

PostPosted: Tue Sep 03, 2013 4:55 pm    Post subject:
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    Post subject: Reply to: JCL Cond Codes
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: 8593
Location: Back in jolly old England

PostPosted: Tue Sep 03, 2013 7:04 pm    Post subject:
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

Site Director


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

PostPosted: Tue Sep 03, 2013 7:34 pm    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Tue Sep 03, 2013 7:46 pm    Post subject:
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    Post subject: Reply to: JCL Cond Codes
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts how to DYNAMICALLY write sort cond to... mohamedmubee COBOL Programming 13 Fri Aug 26, 2016 11:46 pm
No new posts COND parameter vs IF THEN ELSE Alks JCL & VSAM 11 Fri Jun 17, 2016 5:28 pm
No new posts Include Cond issue vickey_dw DFSORT/ICETOOL 6 Tue Mar 29, 2016 8:51 pm
No new posts How to detect the Job COND used tdfs JCL & VSAM 28 Tue Feb 09, 2016 8:34 pm
No new posts Repeating input records for variable ... ksouren007 DFSORT/ICETOOL 1 Fri Jul 31, 2015 4:16 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us