Summary -
In this topic, we described about the below sections -
Condition parameter is used to decide execution of the JOB step based on the return code. And also COND parameter used to specify the return code validation the system uses to determine whether a job step will continue processing or not.
COND parameter can be coded at JOB level and Step level. COND parameter is optional parameter. Maximum 8 conditions can be coded in single COND. More than one condition is separated by comma (,).
If COND coded at step level and the coded condition is false, system executes the step. If COND coded at step level and the coded conditioned is true, system bypass the step execution and terminates the job.
COND parameter is used to override the system default sequence of execution. Bypassing the step based on the return code is not equal to terminating a step abnormally. The COND parameter cannot have a null value.
Syntax -
COND[.procstepname] = (return-code,operator) COND[.procstepname] = ((return-code,operator[,stepname][.procstepname]) [,(return-code,operator[,stepname][.procstepname])]... [,EVEN]) [,ONLY] COND=EVEN COND=ONLY
RC/Return-code | In the above syntax, RC is the Return code of precious step. The valid RC values are from 0 to 4095. | ||||||||||||||
RO/Operator | RO is the relational operator used to validate the return code. The valid Relational Operator is like below
| ||||||||||||||
[.procstepname] | Procedure step-name containing ACCT to be affected | ||||||||||||||
Step-name | Specifies the step-name of the RC validated. |
COND parameter divided into four types based on its usage.
- COND=ONLY
- COND=EVEN
- COND= (Rc,Ro)
- COND= (Rc,Ro,Stepname)
COND=ONLY:
ONLY parameter used to execute the step with COND parameter when the previous step execution is unsuccessful. If the previous step execution result is abnormal then the subsequent step must get executed. If the previous step execution result is normal then the subsequent step must get executed.
Syntax -
COND=ONLY
Below table representing the various possible scenarios based on the different input.
Operator | Previous Step Status | Current Step Status |
---|---|---|
ONLY | Not Executed | Will execute |
ONLY | Executed | Will not execute |
Example:
//JOB CARD //S1 EXEC PGM=P1 //S2 EXEC PGM=P2 //S3 EXEC PGM=P3, COND=ONLY //S4 EXEC PGM=P4
Below table shows the possible output scenarios.
S2 Status | S3 Status |
---|---|
Executed | Will not execute |
Not Executed | Will execute |
COND=EVEN:
EVEN parameter used to execute step with COND parameter when the previous step execution is successful/unsuccessful. If the previous step execution result is normal/abnormal then the current step must get executed. COND=EVEN ignores the previous step return code and executes the current step always.
Syntax -
COND=EVEN
Below table representing the various possible scenarios based on the different input.
Operator | Previous Step Status | Current Step Status |
---|---|---|
EVEN | Not Executed | Will execute |
EVEN | Executed | Will execute |
Example:
//JOB CARD //S1 EXEC PGM=P1 //S2 EXEC PGM=P2 //S3 EXEC PGM=P3, COND=EVEN //S4 EXEC PGM=P4
Below table shows the possible output scenarios.
S2 Status | S3 Status |
---|---|
Executed | Will execute |
Not Executed | Will execute |
COND= (RC, RO):
COND= (RC, RO) is used to execute the step with COND parameter based on the condition code returned by previous step. If COND= (RC, RO) is true then the step with COND parameter execution will get bypassed. If COND= (RC, RO) is false then the step with COND parameter will get executed.
Syntax -
COND[.procstepname] = (return-code,operator)
return-code/RC:
In the above syntax, Rc is the Return code of precious step. The valid RC values are from 0 to 4095.
operator/RO:
RO is the relational operator used to validate the return code. The valid Relational Operator is like below
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 |
Below table representing the various possible scenarios based on the different input.
COND Parameter | Continue job | Terminate job |
---|---|---|
COND=(code,GT) | Code <= RC | Code > RC |
COND=(code,GE) | Code < RC | Code >= RC |
COND=(code,EQ) | Code ¬= RC | Code = RC |
COND=(code,LT) | Code >= RC | Code < RC |
COND=(code,LE) | Code > RC | Code <= RC |
COND=(code,NE) | Code = RC | Code ¬= RC |
Example:
//JOB CARD //S1 EXEC PGM=P1 //S2 EXEC PGM=P2 //S3 EXEC PGM=P3, COND=(12,NE) //S4 EXEC PGM=P4
Below table shows the possible output scenarios.
S2 RC=12 | S3 Should Execute |
S2 RC<> 12 | S3 Will not Execute |
COND= (RC, RO, Stepname):
COND= (RC, RO, Stepname) is used to execute the step with COND parameter based on the condition code returned by specified step name in COND. If COND= (RC, RO, Stepname) is true then the step with COND parameter execution will get bypassed.
If COND= (RC, RO, Stepname) is false then the step with COND parameter will get executed. This COND parameter will be used to validate the particular step return code but not previous step.
Syntax -
COND[.procstepname] = (return-code,operator[,stepname][.procstepname])
return-code/RC:
In the above syntax, Rc is the Return code of precious step. The valid RC values are from 0 to 4095.
operator/RO:
RO is the relational operator used to validate the return code. The valid Relational Operator is like below
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 |
Below table representing the various possible scenarios based on the different input.
COND Parameter | Continue job | Terminate job |
---|---|---|
COND=(code,GT,step-name) | Code <= step-name.RC | Code > step-name.RC |
COND=(code,GE,step-name) | Code < step-name.RC | Code >= step-name.RC |
COND=(code,EQ,step-name) | Code ¬= step-name.RC | Code = step-name.RC |
COND=(code,LT,step-name) | Code >= step-name.RC | Code < step-name.RC |
COND=(code,LE,step-name) | Code > step-name.RC | Code <= step-name.RC |
COND=(code,NE,step-name) | Code = step-name.RC | Code ¬= step-name.RC |
Example:
//JOB CARD //S1 EXEC PGM=P1 //S2 EXEC PGM=P2 //S3 EXEC PGM=P3, COND=(12,EQ,S1) //S4 EXEC PGM=P4
Below table shows the possible output scenarios.
S2 RC=12 | S3 Will not Execute |
S2 RC<> 12 | S3 Should Execute |