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

Help needed with COND


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sriramvempaty

New User


Joined: 02 Aug 2007
Posts: 18
Location: india

PostPosted: Thu Nov 20, 2008 1:38 pm
Reply with quote

Hi,

I have a job with below steps

step-1
step-2
--------------------
step-3 should run only when step-2 RC is 8
step-4 should run only if step-2 RC is 0
step-5 should run only if step-2 RC is 0
-------------------
step-6 should run only if step-5 RC is 8
step-7 should run only if step-5 RC is 0
step-8 should run only if step-5 RC is 0

Please help me out in setting up the conditions for the above steps.

I just want to set the conditions.

Thanks
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Nov 20, 2008 1:44 pm
Reply with quote

why don' t You try with the IF constructs
people who will have to maintain Your jcl will be grateful forever
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Nov 20, 2008 1:44 pm
Reply with quote

Have you read the JCL manual to see how COND= works ?

Have you considered IF/THEN/ELSE as an alternate method ?
Back to top
View user's profile Send private message
Simon Jia

New User


Joined: 21 Nov 2008
Posts: 5
Location: China

PostPosted: Fri Nov 21, 2008 8:50 am
Reply with quote

in step 3 put this COND parm:
Code:
// .....COND=(8,EQ,STEP2)


you can figure out the rest, right?
Back to top
View user's profile Send private message
Simon Jia

New User


Joined: 21 Nov 2008
Posts: 5
Location: China

PostPosted: Fri Nov 21, 2008 8:57 am
Reply with quote

Simon Jia wrote:
in step 3 put this COND parm:
Code:
// .....COND=(8,EQ,STEP2)


you can figure out the rest, right?



Sorry, made a mistake here, the above code means, do NOT execute the step if step2's rc=8. If you want the step to be run only when step2's rc=8, use the following:
Code:
// .....COND=(8,NE,STEP2)

This means do not execute the step when step2's rc != 8...
Back to top
View user's profile Send private message
sriramvempaty

New User


Joined: 02 Aug 2007
Posts: 18
Location: india

PostPosted: Fri Nov 21, 2008 12:28 pm
Reply with quote

If else provided me the desired result.

Thanks.
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: Sun Nov 23, 2008 7:10 am
Reply with quote

Thanks for considering IF/THEN/ELSE/ENDIF over COND. As Enrico said, your successors will appreciate it.
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 Mainframe Programmer with CICS Skill... Mainframe Jobs 0
No new posts Help needed to assemble IMS sample co... ABENDS & Debugging 4
No new posts RABBIT HOLE NEEDED - "Live"... All Other Mainframe Topics 0
No new posts Reference for COND parameter. JCL & VSAM 1
Search our Forums:

Back to Top