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 |
Can anyone tell me the syntax for printing two files at two different destinations in a single step?
hello friends ,i have exam in Hsbc,pls any on send me placement papers and technical questions on mainframes,thank u
whats the difference between empty and noempty of GDG?
I have two input files i/p1 name id-key flag date i/p 2 name id-key date if id-key matches in the both the files then it should write the output file from i/p1 with flag 'Y'. It should be done thru JCL sort card ,Please provide the info on this. ---Note : output file should have all records from i/p1 with proper Flag.
Explain the function of job statement in jcl?
Max. No of DD statements in a job ?
If your job fails at particular step then what would be the return code for next steps
Is stepname is a MUST and should be unique also for each JOBSTEP ? or system can supply the stepname for a step which is not given a name by the programmer ?
wht do u mean by notify parameter, how can u give acess to multiple users ?
a dd statement has 2 types of parameters. Name them?
Can a PS file be read in reverse order?If so,how
how do u define a file in cobol and jcl ?