Page 1 of 1

COND Parmeter in JCL.

Posted: Sun Oct 12, 2014 11:42 am
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?

Re: COND Parmeter in JCL.

Posted: Sun Oct 12, 2014 3:04 pm
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.

Re: COND Parmeter in JCL.

Posted: Mon Oct 13, 2014 2:36 pm
by Abhijit Patwal
Thanks. So if I put COND=(0,LT) or COND=(0,EQ) they both should behave same?

Re: COND Parmeter in JCL.

Posted: Tue Oct 14, 2014 5:06 pm
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

Re: COND Parmeter in JCL.

Posted: Wed Oct 15, 2014 3:38 pm
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?

Re: COND Parmeter in JCL.

Posted: Sat Oct 18, 2014 3:13 am
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.