Explain the usage of COND parameter in JCL with an example

Showing Answers 1 - 6 of 6 Answers

SWATI

  • Apr 19th, 2007
 

1) The COND specifies condition for execution of subsequent job step depend on the return code from previous steps.
2) COND Can be coded in both JOB and EXEC statements. But COND written in EXEC stmt overrides on COND written in JOB stmt.
3) MAximum 8 conditions can be coded in the COND parameter. In case of multiple conditions if ANY of the  condition is found TRUE then the JOB stops proceeding further.
4)It bypasses the step if the condition is true.


SYNTAX :  COND=(CODE,OPERATOR,STEPNAME)
code can be 0 to 4095
Operator can be GT, LT, GE, LE, EQ
Stepname is optional,if omitted then the reurn code of all the steps are checked.

In EXEC you may find like

   COND=ONLY it allows step execution if any prior step is ABENDED
   COND=EVEN it allows step execution even if the prior step is ABENDED

 Example.
//STEP2 EXEC PGM=PROG12,COND=(4,GT,STEP1)

Here system bypasses the  STEP2 if 4 is greater than the return code from STEP1


 

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions