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

COND codes based on any of the preceding steps


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Tue Mar 03, 2009 11:14 pm
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
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

Global Moderator


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

PostPosted: Wed Mar 04, 2009 12:40 am
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
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

Moderator Emeritus


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

PostPosted: Wed Mar 04, 2009 1:18 am
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
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
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 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 CA7 deleting files in steps after job... CA Products 4
No new posts To search DB2 table based on Conditio... DB2 1
This topic is locked: you cannot edit posts or make replies. Merge 2 input files based on the reco... JCL & VSAM 2
Search our Forums:

Back to Top