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 |
How to release a JOB (from the input queue) held by TYPRUN = HOLD ? and how to see the installation default time after which a JOB will be automatically released ? How to see the list of currently HELD JOBS ?
how to identify the file used in the JCL is an VSAM file. Just seeing the JCL code how can we track the file as VSAM file?
what is use of space parameter in dd statement?
What does the keyword DCB mean and what are some of the keywords associated with it?
what is mainframe?
If I update one or more members in a pds in the step 1, how can I reach these new contents to be used in the step 2 of the same job? To start a new job via intrdr is not satisfactory, because I must solve this problem in one job.
What is the function of job statement in jcl?
Could anyone please suggest me what is the maximum length of data that can be pass as input in //sysin dd * This was asked in interview. TIA
what if any ,is the syntax error in the following piece of code 01 B PIC A(7) 02 C PIC 9(4) ........ IF(B NUMERIC) ADD 10 TO C a.the condition in the if statement is wrong b.noting is wrong c.because C is initialised.ADD 10 TO C is wrong d.both B and C shoud have same size.
How can a fb file convert to vb file using sort program?
how to compare two datasets without using superce because output is limited to 133 bytes
How many positional parameters are there in job statement?