View previous topic :: View next topic
|
Author |
Message |
Rajesh Ayamchirakkunnel
New User
Joined: 18 Mar 2008 Posts: 3 Location: Mysore
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
//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 |
|
|
Rajesh Ayamchirakkunnel
New User
Joined: 18 Mar 2008 Posts: 3 Location: Mysore
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Yeah, that should do it. |
|
Back to top |
|
|
Rajesh Ayamchirakkunnel
New User
Joined: 18 Mar 2008 Posts: 3 Location: Mysore
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Try COND=(0,NE). |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Is there a reason why you are not considering using the newer and recommended IF/THEN/ELSE/ENDIF construct? |
|
Back to top |
|
|
xtinct
New User
Joined: 07 Mar 2009 Posts: 4 Location: Mysore
|
|
|
|
yes using if statement you can solve that. or another option is using cond on JOB |
|
Back to top |
|
|
|