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
 

 

COND codes based on any of the preceding steps

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Rajesh Ayamchirakkunnel

New User


Joined: 18 Mar 2008
Posts: 3
Location: Mysore

PostPosted: Tue Mar 03, 2009 11:01 pm    Post subject: COND codes based on any of the preceding steps
Reply with quote

Hi,

I want to code a COND=() parameter in the third step of this JCL.

STEP1 PGM=PGM1
STEP2 PGM=PGM2
STEP3 PGM=PGM,COND=()

What should be the COND code if I want STEP3 to be executed when either STEP1 or STEP2 has a return code not zero. For example if STEP1.RC=0 and STEP2.RC=12, STEP3 should execute. Also, when STEP1.RC=12 and STEP2.RC STEP3 should execute. But when STEP1.RC=0 and STEP2.RC=0 STEP3 should be bypassed.

Can somebody please help as I am confused after reading this line from one of the manuals - "When the COND parameter does not name a previous step, the system tests all previous
steps. If any test is satisfied, the system bypasses the current step"

Thanks,
Rajesh
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Mar 03, 2009 11:14 pm    Post subject: Reply to: COND codes based on any of the preceding steps
Reply with quote

//STEP3 PGM=PGM,COND=(0,EQ)

seems to be what you want (bypass execution if any previous step has a Return-Code equal to zero).
Back to top
View user's profile Send private message
Rajesh Ayamchirakkunnel

New User


Joined: 18 Mar 2008
Posts: 3
Location: Mysore

PostPosted: Wed Mar 04, 2009 12:37 am    Post subject: Reply to: COND codes based on any of the preceding steps
Reply with quote

Kevin,

I want to execute STEP3 when any previous step has a return-code greater than zero. STEP3 should be bypassed when all the previous steps have return-codes equal to zero.

Thanks,
Rajesh
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Mar 04, 2009 12:40 am    Post subject: Reply to: COND codes based on any of the preceding steps
Reply with quote

Yeah, that should do it.
Back to top
View user's profile Send private message
Rajesh Ayamchirakkunnel

New User


Joined: 18 Mar 2008
Posts: 3
Location: Mysore

PostPosted: Wed Mar 04, 2009 1:08 am    Post subject: Reply to: COND codes based on any of the preceding steps
Reply with quote

Nope, COND=(0,EQ) doesn't meet my requirements.
Suppose, STEP1.RC=0 and STEP2.RC=12. As we are not coding the STEP name in the COND, it checks all the previous steps to see if anyone staisfies the condition and STEP1 does. So it bypasses STEP3. but my requirement is to execute STEP3 in this scenario.
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: Wed Mar 04, 2009 1:18 am    Post subject:
Reply with quote

Hello,

Try COND=(0,NE).
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: Wed Mar 04, 2009 6:10 am    Post subject:
Reply with quote

Is there a reason why you are not considering using the newer and recommended IF/THEN/ELSE/ENDIF construct?
Back to top
View user's profile Send private message
xtinct

New User


Joined: 07 Mar 2009
Posts: 4
Location: Mysore

PostPosted: Sat Mar 07, 2009 5:29 pm    Post subject:
Reply with quote

yes using if statement you can solve that. or another option is using cond on JOB
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 Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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