Dear All,
I have to put a Condition code to a Step name which resides in a proc,
and make that step to bypass and execute in certain Return codes
Can any one suggest me syntax of it
Regards,
Kishore
Need Syntax
Moderators: Frank Yaeger, DikDude, Moderator Group
Hi
Hi Nanda Kishore,
COND parameter can be coded at 2 places 1) at JOB 2) at EXEC
Below is the detailed information about both of them.
1) at JOB
The COND parameter is used to specify the return code tests the
system uses to determine whether a job will continue processing.
The COND parameter on the JOB statement is global in scope for the
entire job.
Before each job step is executed, MVS performs the COND parameter tests against the return codes from one or more previously completed job steps. If none of these tests are satisfied, the system executes the job step; if any test is satisfied, the system skips ALL remaining job steps and terminates the job immediately.
The tests are made against return codes from the current execution of the job. A step bypassed because of an EXEC statement COND parameter does not produce a return code.
Note that skipping a step because of a return code test is not the same as abending the step. The system abends a step following an error that is serious enough to keep successful execution from occurring. Skipping of a step just keeps it from being executed.
Note: The JOB statement COND parameter determines if job steps are to be skipped or executed. JES3 processes all jobs as if each step will ultimately be executed, and therefore allocates devices for steps that may be eventually be skipped because of the COND parameter tests, so the devices must still be available when the job is submitted.
Syntax:
COND=(code,operator)
COND=((code,operator){,(code,operator)}...)
COND=((code,operator){,(code,operator)}...)
o A single return code test is specified as: (code,operator)
o You can leave off the outer set of parentheses if you code only one return code test
o Up to eight return code tests can be specified per job
The "code" value can be any decimal value in the range 0 to 4095;
the "operator" can be one of the following:
EQ - equal
LT - less than
LE - less than or equal to
NE - not equal
GT - greater than
GE - greater than or equal to
Example 1: Flush the remaining steps in this job if any step's return code is less than 4:
//MYJOB JOB (1234,,2,1),'TEST',COND=(4,GT)
Example 2: Restart this job at stepname JS230, and use the COND=
parameter to force the rest of the job to be skipped:
//PROD010 JOB ('S129-?21'),'ZBD PRODUCTION',RESTART=JS230,
//COND=0,LE)
2) at EXEC
The COND parameter is used to specify the return code tests that MVS will perform to see if a job step will be executed or not. Before a job step containing a COND= parameter is executed, MVS performs the COND parameter test(s) specified against the return codes from all prior job steps or the steps named on the COND= parameter. If none of these tests is satisfied, the system executes the job step; if any test is satisfied, the system skips the job step on which the
COND= parameter is coded.
Tests are made against return code values for the current execution of the job. A step skipped because of an EXEC statement COND parameter will not produce a return code, because it will not be executed.
Note that skipping a step because of a return code test is not the same as abending the step. The system abends a step following an error that is serious enough to keep successful execution from occurring. Skipping of a step just keeps it from being executed.
Note: The statement COND parameter determines if job steps are to be skipped or executed. JES3 processes all jobs as if each step will ultimately be executed, and therefore allocates devices for steps that may be eventually be skipped because of the COND parameter tests, so the devices must still be available when the job is submitted.
Syntax:
COND{.procstepname}=(code,operator{,stepname}{.procstepname})
or
COND{.procstepname}=((code,operator{,stepname}{.procstepname}),
{,(code,operator{,stepname}{.procstepname})}...)
or
COND=EVEN | ONLY
o A single return code test is specified as: (code,operator)
o You can leave off the outer set of parentheses if you code only one return code test
o Up to eight return code tests can be specified per job step
o 'stepname' is the name of the step against which the return code test is to be performed; 'procstepname' is needed if the step whose return code you are testing is in a JCL procedure
The "code" value can be any decimal value in the range 0 to 4095; the "operator" can be one of the following:
EQ - equal
LT - less than
LE - less than or equal to
NE - not equal
GT - greater than
GE - greater than or equal to
COND=EVEN tells MVS to execute this job step EVEN IF a prior step in the same job abends, unless the job is canceled by the MVS operator.
COND=ONLY tells MVS to execute this job step ONLY IF a prior step in the same job abends.
Example 1: Skip a link edit step if the previous step named COMPILE set a condition code (return code) of 8 or higher:
//LINK EXEC PGM=IEWL,PARM='LET,LIST,MAP,XREF',
// COND=(8,LE,COMPILE)
COND parameter can be coded at 2 places 1) at JOB 2) at EXEC
Below is the detailed information about both of them.
1) at JOB
The COND parameter is used to specify the return code tests the
system uses to determine whether a job will continue processing.
The COND parameter on the JOB statement is global in scope for the
entire job.
Before each job step is executed, MVS performs the COND parameter tests against the return codes from one or more previously completed job steps. If none of these tests are satisfied, the system executes the job step; if any test is satisfied, the system skips ALL remaining job steps and terminates the job immediately.
The tests are made against return codes from the current execution of the job. A step bypassed because of an EXEC statement COND parameter does not produce a return code.
Note that skipping a step because of a return code test is not the same as abending the step. The system abends a step following an error that is serious enough to keep successful execution from occurring. Skipping of a step just keeps it from being executed.
Note: The JOB statement COND parameter determines if job steps are to be skipped or executed. JES3 processes all jobs as if each step will ultimately be executed, and therefore allocates devices for steps that may be eventually be skipped because of the COND parameter tests, so the devices must still be available when the job is submitted.
Syntax:
COND=(code,operator)
COND=((code,operator){,(code,operator)}...)
COND=((code,operator){,(code,operator)}...)
o A single return code test is specified as: (code,operator)
o You can leave off the outer set of parentheses if you code only one return code test
o Up to eight return code tests can be specified per job
The "code" value can be any decimal value in the range 0 to 4095;
the "operator" can be one of the following:
EQ - equal
LT - less than
LE - less than or equal to
NE - not equal
GT - greater than
GE - greater than or equal to
Example 1: Flush the remaining steps in this job if any step's return code is less than 4:
//MYJOB JOB (1234,,2,1),'TEST',COND=(4,GT)
Example 2: Restart this job at stepname JS230, and use the COND=
parameter to force the rest of the job to be skipped:
//PROD010 JOB ('S129-?21'),'ZBD PRODUCTION',RESTART=JS230,
//COND=0,LE)
2) at EXEC
The COND parameter is used to specify the return code tests that MVS will perform to see if a job step will be executed or not. Before a job step containing a COND= parameter is executed, MVS performs the COND parameter test(s) specified against the return codes from all prior job steps or the steps named on the COND= parameter. If none of these tests is satisfied, the system executes the job step; if any test is satisfied, the system skips the job step on which the
COND= parameter is coded.
Tests are made against return code values for the current execution of the job. A step skipped because of an EXEC statement COND parameter will not produce a return code, because it will not be executed.
Note that skipping a step because of a return code test is not the same as abending the step. The system abends a step following an error that is serious enough to keep successful execution from occurring. Skipping of a step just keeps it from being executed.
Note: The statement COND parameter determines if job steps are to be skipped or executed. JES3 processes all jobs as if each step will ultimately be executed, and therefore allocates devices for steps that may be eventually be skipped because of the COND parameter tests, so the devices must still be available when the job is submitted.
Syntax:
COND{.procstepname}=(code,operator{,stepname}{.procstepname})
or
COND{.procstepname}=((code,operator{,stepname}{.procstepname}),
{,(code,operator{,stepname}{.procstepname})}...)
or
COND=EVEN | ONLY
o A single return code test is specified as: (code,operator)
o You can leave off the outer set of parentheses if you code only one return code test
o Up to eight return code tests can be specified per job step
o 'stepname' is the name of the step against which the return code test is to be performed; 'procstepname' is needed if the step whose return code you are testing is in a JCL procedure
The "code" value can be any decimal value in the range 0 to 4095; the "operator" can be one of the following:
EQ - equal
LT - less than
LE - less than or equal to
NE - not equal
GT - greater than
GE - greater than or equal to
COND=EVEN tells MVS to execute this job step EVEN IF a prior step in the same job abends, unless the job is canceled by the MVS operator.
COND=ONLY tells MVS to execute this job step ONLY IF a prior step in the same job abends.
Example 1: Skip a link edit step if the previous step named COMPILE set a condition code (return code) of 8 or higher:
//LINK EXEC PGM=IEWL,PARM='LET,LIST,MAP,XREF',
// COND=(8,LE,COMPILE)
Kumar
If u can dream it, U can do it.
If u can dream it, U can do it.
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page