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 |
what are the types of abends that occur on job failure? And explain the possible causes of these
Explain how can an in-stream dataset be terminated?
i have a jcl calling proc which has 10 steps, i want to execute from step5 to step10, where can i code RESTART and COND parameter?
What are the rules employed while naming the steps in a job?
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
which utility is used to run a cobol-db2 program?
Can an individual step be restricted from using all the jobs allowed cpu time?
Which storage devices are grouped under DASD and SYSDA ?
I have four steps in jcl they are STEP1,STEP2,STEP3 and STEP4. Can it possible to run the reverse order like step4 first then step3,step2,step1?
ihave ten flatfile in that iwant to concatinate all the files except file 5,6 into output file by uing jcl? how to do this? give me detail yntax for tis?
if we have a job consist of two steps and each step calling a proc having 10 steps each then how many steps are counted only 2 or 22(10+10+1+1)? can we have more than 255 steps in a single job?
How to identify where file is empty or not? How many ways are there to identifying?