InterviewSolution
| 1. |
What happens when COND is coded in JOB statement and EXEC statement? |
|
Answer» In JCL, a COND parameter can be incorporated into the JOB STATEMENT or EXEC statement. This parameter can be used to skip steps based on return codes from previous steps. Here, we are testing the return code from the previous job steps. In the EVENT that the test is deemed to be true, the current job step execution is bypassed. Bypassing a job step is not an ABNORMAL termination, but simply an omission.
Example: //MATEKSD JOB MSGLEVEL=(1,1),NOTIFY=&SYSUID, COND=(0,NE)//STEP01 EXEC PGM=CONDPGM1//STEP02 EXEC PGM=CONDPGM2,COND=(0,EQ)//STEP03 EXEC PGM=CONDPGM3,COND=(4,EQ)Explanation of COND=(0 NE) As you can see, the COND parameter is set to (0,NE) at the JOB level. In particular, it will check if the return code 0 does not equal the return code of any of the steps in JCL? If this is true, then the job should be terminated. As a result, if any of the steps (such as STEP01, STEP02, or STEP03) returns a non-zero return code, this condition will be true and the job will be terminated. |
|