In all our JOB Statement we have always COND=(4,LT) defined. Nevertheless when a Job failed the last step should then be executed (send a message to an user). Due to we don't like to change all our JOB's (ca. 2000), we are looking for a simply solution.
Answers were Sorted based on User's Feedback
Answer / himap
This is from JCL User guide....
Step Execution after a Preceding Step Abnormally Terminates
Abnormal termination of a step usually causes the system to bypass subsequent
steps and to terminate the job. However, the EXEC statement COND parameter
lets you request execution of a step by coding:
//stepname EXEC PGM=x,COND=EVEN
The step is to be executed even if one or more of the preceding steps
abnormally terminates. That is, the step will always be executed, whether or not
a preceding step abnormally terminates.
//stepname EXEC PGM=x,COND=ONLY
The step is to be executed only if one or more of the preceding steps
abnormally terminates. That is, the step will not be executed, unless a
preceding step abnormally terminates.
If a step abnormally terminates, the system scans the EXEC COND parameter for
the next step for an EVEN or ONLY subparameter. If neither is present, the system
bypasses the step. If EVEN or ONLY is specified, the system makes any requested
return code tests against the return codes from previous steps that executed and
Chapter 10. Processing Jobs - Processing Control 10-7
Processing Jobs - Processing Control
did not abnormally terminate. The step is bypassed if any test is satisfied.
Otherwise, the step is executed.
Note: Certain error conditions prevent the system from executing a step,
regardless of any requests specified through the COND parameter. Other
considerations are also related to the use of the COND parameter. For
information on cautions when specifying COND parameters, see the
description of the COND parameter on the EXEC statement in OS/390 MVS
JCL Reference.
Hope this answers your question.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / anudeep
Hi,
Please used COND=ONLY in your last step which has to be executed whenever the jobs fails.
Thanks.
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / herm ballast
The COND in the JOB Statement overwrites all the COND in the STEP Statement, so it does work.
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / anudeep
Hi ,
You can use the keyword COND=ONLY at the last.
This step will execute only if the job fails at any step.
Thanks,
Anudeep
Is This Answer Correct ? | 0 Yes | 2 No |
Step 1 RC 4 Step 2 Step 3 I want to know the COND parameter which can be coded in step 2 or 3. Step 2 should be executed based on Step 1 RC and Step 3 should not be executed based on step 1's RC
how can we pass parameters from JCL to cobol subprogram...my requirement is i should not get data from mainprogram but i need it from JCL directly
Explain the purpose of dd dummy statement?
how to increase the space of a dataset in instream procedure.
What parameter directs the output of the job log dataset?
how do u see jobs submitted before ur job ?
Must tape dataset definitions include vol=ser specifications?
I want to JCL sort for Non-COMP and COMP-3 fields SORT FIELDS=(1,5,A,6,11,A,12,11,A,19,1,A,20,1,A),FORMAT=BI,EQUALS Length of comp bytes is 11 bytes which start at 6byte and 12 byte considering 11 bytes in comp-3 is 6 bytes. Can anyone tell if the above sort work SORT FIELDS=(1,5,A,6,6,A,12,6,A,19,1,A,20,1,A),FORMAT=BI,EQUALS does not works OK
What is difference between Return Code, user completion code, Abend code and reason Code?
What is job control language?
Suppose there r total 10 steps. Out of which i want to execute only the 7th step. How can i do that....????
If we want to see the eliminated duplicate record thru SORT, how its output file will be managed