The parameter COND controls your job steps execution as you wish in your JCL. There are some key diffrences for giving COND parameter in JOB and in STEP.
To indicate the results of its execution, a program can issue a return code. Using a COND parameter, you can test the return code and, based on the test, either bypass or execute a step.
The COND parameter can be specified on either a JOB or EXEC statement by coding:
//jobname JOB acct,progname,COND=(code,operator) //jobname JOB acct,progname, // COND=((code,operator),(code,operator)) //stepname EXEC PGM=x,COND=(code,operator) //stepname EXEC PGM=x,COND=(code,operator,stepname) //stepname EXEC PROC=x, // COND=((code,operator,stepname.procstepname)) //stepname EXEC PGM=x,COND=EVEN //stepname EXEC PGM=x,COND=ONLY //stepname EXEC PGM=x,COND=((code,operator),EVEN) //stepname EXEC PGM=x,COND=((code,operator,stepname),ONLY)
Top Ideas
- If an EXEC statement COND parameter causes a step to be bypassed, only that step is not executed; the following steps are executed or not, depending on their COND parameters.
- If a JOB statement COND parameter causes a step to be bypassed, the system bypasses all remaining job steps. Bypassing a step because of an EXEC COND parameter is not the same as abnormally terminating the step.
- Bypassing permits the following steps to be executed; abnormally terminating causes all following steps to be bypassed, unless they contain EVEN or ONLY in their EXEC COND parameters.
Related: