I am having a doubt regarding COND PARAMETER.
Following are the details of the JCL with CONDitions applied to the STEPS of the JCL :
STEPNAME ------RC
STEP005 ------ NO COND PARAMETER HANDLE
STEP010 ------ COND=(0,NE)
STEP020 ------ COND=(4,LT,STEP010)
STEP030 ------ COND=((4,LT,STEP010),(0,NE,STEP020))
STEP040 ------ ?
NOW STEP040 should run to all conditions where-if the previous steps fails with RC = 00 / 04, this STEP should not FLUSH. & with any other RC return STEP040 should FLUSH.
I have coded
//STEP040 EXEC PGM=XXXX,COND=(4,LT,STEP030)
This fulfills the requirement!
But I had a doubt regarding COND parameter, that, as per my knowledge for any STEP which includes COND parameter like (code, operator{,previous stepname}), it means that if the condition goes false for the previous STEP then only the subsequent STEP should run.
So as per my requirement STEP040 should run with following CODE :
//STEP040 EXEC PGM=XXXX,COND=(4,GT)
But the requirement is not getting done with the above CODE.
Can you please help me out regarding this and correct me if I am wrong regarding COND parameter concept?
STEP040 should run in all cases where either of the steps viz. STEP005, STEP010, STEP020, STEP030 returning RC= 00/04.
& STEP040 should FLUSH in case either of the stpes viz. STEP005, STEP010, STEP020, STEP030 returning RC > 04.
For the above requirement I thought that code
//STEP040 EXEC PGM=XXXX,COND=(4,GT)
should ideally work.
But I got the requirement done with
//STEP040 EXEC PGM=XXXX,COND=(4,LT,STEP030) .
I just wanted to clarify my knowlenge regarding COND PARAMETER.
Is it that?
Any STEP which includes COND parameter like (code, operator), it means that if the condition goes false for the previous STEP then only the subsequent STEP should run.
((If the above statement is true then I should get the requirement done by
//STEP040 EXEC PGM=XXXX,COND=(4,GT).))
Or am I going wrong with the concept as here its working on the other way i.e.
Any STEP which includes COND parameter like (code, operator{,previous stepname}), it means that if the condition goes true for the previous STEP then only the subsequent STEP should run.
It shouldn't work. Because this means if 4 is GREATER than any previous return code, then don't run STEP040.
So if STEP030 ends with 00, 01, 02, 03 then STEP040 doesn't run.
As per your STATEMENT If in previous steps RC > 4 ,STEP040 should not run.
That implies if previous STEPs returns 00, 01, 02, 03, 04 then STEP040 should run.
This is the CONDition which is satisfies my requirement in the JCL!
But actually its working in the reverse case!
//STEP040 EXEC PGM=XXXX,COND=(4,LT,STEP030)