View previous topic :: View next topic
|
Author |
Message |
Prabha Warnings : 2 New User
Joined: 05 Dec 2005 Posts: 79
|
|
|
|
Hi,
Please clarify me the below condition
Case1 :
STEP1 EXEC PGM=XXX
STEP2 EXEC PGM=XXY,COND=(0,LT)
STEP3 EXEC PGM=XXZ
case 2:
STEP1 EXEC PGM=XXX
STEP2 EXEC PGM=XXY,COND=(0,LE)
STEP3 EXEC PGM=XXZ
Here confirm whether STEP2 will run or bypass if return code from step1 is zero in both the scenarios.
I know in 2nd case, STEP2 will get bypassed if return code is 0 from STEP1. But in case 1??
Regards,
Prabha. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Isn't this something that would take less time to test rather than ask ? |
|
Back to top |
|
|
anshul_gugnani
New User
Joined: 02 Nov 2009 Posts: 73 Location: Mumbai
|
|
|
|
Hi,
In case 1 - step2 will run
In case 2 - step2 will be bypassed.
Thanks. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
easy to remember,
if condition is true, step is bypassed. |
|
Back to top |
|
|
santy Warnings : 1 New User
Joined: 19 Jul 2007 Posts: 22 Location: mumbai
|
|
|
|
in
CASE1-
condition (Return code of step1 (i.e. zero) is not LT 0)
condition was not satisfied
that's y step2 will execute.
CASE2-
condition (Return code of step1 (i.e. zero) is LE 0)
condition was satisfied,
that's y step2 will bypass.
in sort to remember, COND condition is exactly performing vice versa to IF condition.
In COND, if condition satisfied then step will bypass and
in IF condition, if condition satisfied then step will excute.
hope this will clear your doubt. :) |
|
Back to top |
|
|
Elixir
Active User
Joined: 08 Feb 2009 Posts: 116 Location: CHENNAI/NEW JERSEY - INDIA/USA
|
|
|
|
Prabha wrote: |
Hi,
Please clarify me the below condition
Case1 :
STEP1 EXEC PGM=XXX
STEP2 EXEC PGM=XXY,COND=(0,LT)
STEP3 EXEC PGM=XXZ
case 2:
STEP1 EXEC PGM=XXX
STEP2 EXEC PGM=XXY,COND=(0,LE)
STEP3 EXEC PGM=XXZ
Here confirm whether STEP2 will run or bypass if return code from step1 is zero in both the scenarios.
I know in 2nd case, STEP2 will get bypassed if return code is 0 from STEP1. But in case 1??
Regards,
Prabha. |
Cond parameter in JCL is very useful to bypass or execute a STEP.
The syntax look like below,
(return-code-user-set-by-user,comparison-parameter,previous-step-return-code/stepname-whose-return-code-is-to-be-considered)
The Thumb rule is if the conditon is not satisfied, the step is executed.
If the condition is satisfied the step is bypassed.
How it works in your examples?????.....
Case1 :
I) if the return-code of step1 is 0, (0,LT,0) is false. So step2 will be executed.
II) if the retrun-code of step1 is non-zero( i. e) greater the 0, in that case
(0,LT,A) {where A>0} is true. So step2 will be bypassed.
Case2 :
In this case (0,LT,B) {where B=0,1,2...} will always be satisfied. So this condition gets satisfied and step2 will be always bypassed.
Also COND has lot of other parameters also. It would be better to go through the JCL manuals to get a better hold of it.
Kindly let me know for any thing more on it |
|
Back to top |
|
|
ranisupriya
New User
Joined: 03 Jul 2009 Posts: 3 Location: bangalore
|
|
|
|
In Case 1 : Step 2 will execute. Condition given (0,LT) means if RC of step 1 is less than 0 step 2 should not run. But RC of step1 is 0 and 0 is not less than 0 so condtion is not true so Step 2 will execute. |
|
Back to top |
|
|
|