JCL Basics What is JCL? Job Entry Subsystem Job Processing JCL Statements JCL Parameters JOB Statement Job Statement Parameters for Job Positional Parameters ACCT NAME Keyword Parameters MSGLEVEL MSGCLASS TYPRUN PRTY CLASS RESTART REGION TIME NOTIFY EXEC Statement EXEC Statement Positional Parameters PGM PROC Keyword Parameters COND PARM ADDRSPC DD statement DD statement DD Parameters SPACE SYSIN VOL DCB SYSOUT DSN UNIT DISP |
COND parameter • It determines whether a step needs to be executed or bypassed based on the return code of previous steps. • It can be coded on both JOB & EXEC statement. • COND on JOB: – COND=(code,operator) • COND on EXEC: – COND=(code,operator,stepname,EVEN/ONLY) • Code – Return code of previous step. • Operator - Specifies the relational operator for comparison. If the parameter is coded in JOB, then the comparison is made with the previous executed step. If the parameter is coded in STEP, then the return code of the step name mentioned in the parameter is used. If the step name is not mentioned, then it takes the return code of the previous executed step by default. • Operator Meaning GT - Greater Than GE - Greater than or Equal to EQ - Equal to LT - Less Than LE - Less Than or Equal to NE - Not Equal to • If the specified test is true, the system bypasses all remaining job steps. • EVEN in the COND parameter means the step should be executed EVEN if any of the above steps have abended. • ONLY in the COND parameter means the step should be executed ONLY if any of the previous steps have abended. • Example - 1 //JCL1234 JOB //STEP1 EXEC PGM=IEFBR14 //STEP2 EXEC PGM=IEFBR14,COND=(0,EQ) Outcome: STEP1 gets executed with RC=0 STEP2 gets bypassed because the condition 0 EQ 0 is true. • Example - 2 //JCL1234 JOB //JOBLIB DD DSN=LIBRARY.JCLSCHL.JCLLIB,DISP=SHR //STEP1 EXEC PGM=PGM1 (RC=0) //STEP2 EXEC PGM=PGM2 (RC=8) //STEP3 EXEC PGM=PGM3,COND=(0,NE,STEP1) (RC=0) //STEP4 EXEC PGM=PGM4 (RC=0) Outcome: In the given example, Consider, STEP1 gets executed with RC=0. STEP2 gets executed with RC=8. STEP3 gets executed with RC=0. STEP4 gets executed with RC=0. The RCs mentioned are applicable only when the step is executed. In the example COND is coded in STEP3. In the COND, if the third parameter STEP1 is not coded, it will compare the return code of STEP2 by default (and would have bypassed the STEP1). But since the step name is also coded, it compares with the RC of STEP1. |
Copyright.
All the contents of this website are designed by owner of this website. The material cannot be used to display on any other website without the owners permission.
All the contents of this website are designed by owner of this website. The material cannot be used to display on any other website without the owners permission.