COND Parmeter in JCL.

JES2/3, JCL, utilities.
Post Reply
Abhijit Patwal
New Member
Posts: 4
Joined: Mon Aug 11, 2014 9:28 am

COND Parmeter in JCL.

Post by Abhijit Patwal »

Hi,

I'm confused with COND parameter:

1.if I code COND=(0,LT) whether it checks previous step's RC is less than 0 or 0. I think that it will check if 0 is less than previous step's rc condition is false. So it'll execute that particular step. Please clarify me which is correct.

But then can RC be less than 0?

2. Let's assume if we COND=(4,LT) in step4 and step2's rc is 8 and step3's rc is 0 whether step4 will execute or not?
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: COND Parmeter in JCL.

Post by William Collins »

You are correct, the condition code can never be less than zero. So "always true". Experiment. Search. Read. COND= is confusing :-), so don't worry if you start off confused. If you work out yourself what is actually going on, you won't have to re-understand from someone's direct explanation, so it'll be easier for you.
Abhijit Patwal
New Member
Posts: 4
Joined: Mon Aug 11, 2014 9:28 am

Re: COND Parmeter in JCL.

Post by Abhijit Patwal »

Thanks. So if I put COND=(0,LT) or COND=(0,EQ) they both should behave same?
Chandan Yadav
Website Team
Website Team
Posts: 70
Joined: Wed Jul 31, 2013 10:19 pm

Re: COND Parmeter in JCL.

Post by Chandan Yadav »

Hi Abhijit,

COND=(0,LT) will always execute the step on which it is coded as the condition will be always false whereas COND=(0,EQ) will bypass the step if previous steps executed with return code 0.

Regards,
Chandan
Ashu Jain
New Member
Posts: 4
Joined: Thu Aug 14, 2014 3:29 pm

Re: COND Parmeter in JCL.

Post by Ashu Jain »

chandanyadav wrote:COND=(0,LT) will always execute the step on which it is coded as the condition will be always false whereas COND=(0,EQ) will bypass the step if previous steps executed with return code 0.

Regards,
Chandan
I did not get it, can you please elaborate?
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: COND Parmeter in JCL.

Post by nicc »

Write yourself a little program that takes a value as a parameter and uses that to issue a return code. Create a procedure with as many executions of the program as you need with differing parameters and condition codes and check out the results.
Regards
Nic
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “JCL - Job Control Language.”