IDJOB5-ENDED-OK ODAT +
You are now ready to define the ON and DO statements. These will include your restart parameters.
The meaning of the >C0004 value should be clear. Generally, a step is considered to have ended OK if the routine returns a code of C0004 or lower. Therefore, a CODES value of >C0004 instructs Control-M to perform the accompanying DO statements if the job ended NOTOK.
In the preceding chapter, and again in this step, you specified ANYSTEP as the PGMST step values. These ON step values should be examined more closely.
ON Steps
The ON step fields identify the possible steps against which Control-M will check for the specified CODES values.
Two types of step values can be specified:
You can specify either or both types of values, but you must specify at least one value if you use an ON block.
Valid step values can be any of the following:
Valid keyword values are
DO statements are performed if the CODES criteria are satisfied for any program step.
DO statements are performed only if the CODES criteria are satisfied for all steps, program and/or procedure, depending on the definition.
You can define a range of steps in the STEP RANGE statement, immediately above the ON statement. You must assign a name to this step range.
You can then specify this step range name, preceded by an asterisk, as the step value in the ON statement. The asterisk prefix in the ON statement instructs Control-M to check the program step range defined in the STEP RANGE field, rather than looking for an actual program step by that name.
DO statements are performed if the CODES criteria are satisfied for any program step in the step range.
IDJOB5-END-NOTOK ODAT +
You can now to define a Shout statement to the operator. However, because this is only an exercise and you do not want the shout to actually go to the operator, you will instead send the shout to yourself.
IDJOB5 RUN FAILED. CORRECT PROBLEM AND CONFIRM RESTART.
You are now ready to define your restart parameters. Two statements are generally used in combination, to define a restart:
The DO IFRERUN statement is used to indicate that a restart is desired. It defines parameters to be used for restart, such as FROM step and TO step. This statement tells Control-M that if the job is rerun, hence the name DO IFRERUN, it should be rerun in accordance with the restart values specified in the DO IFRERUN statement.
The DO RERUN parameter merely instructs Control-M to run the job again. If you wanted a rerun without a restart, you would specify only the DO RERUN parameter, and the job would be rerun from the beginning.
The DO IFRERUN statement precedes the DO RERUN statement.
Note that this statement contains FROM, TO, and CONFIRM fields. The default value of the CONFIRM field should be N (No).
Note: The CONFIRM field of the DO IFRERUN statement is similar in meaning to the CONFIRM runtime scheduling parameter that you used in Chapter 1, "Introduction to Control-M." However, it applies only to restarted jobs, whereas the CONFIRM runtime scheduling parameter applies to all job runs.
You can now take a look at the FROM and TO fields.
The FROM field indicates the step from which the restart should begin, and the TO field indicates the step to which the restart should continue.
Both the FROM and the TO fields allow specification of a program step, to the left of the period, and/or a procedure step, to the right of the period. You can specify either or both values.
Table 9 DO IFRERUN: Selected FROM Keyword values
Keyword |
Description |
---|---|
$FIRST |
First step of the job. |
$ABEND |
Step of the job that ended NOTOK due to system abend, user abend, condition code C2000 (PL/1 abend), or JFAIL (job failed on JCL error). $ABEND is a subset of $EXERR, described below. |
$FIRST.$ABEND |
First step of the abended procedure. |
$EXERR |
Job step that ended with any error, including an abend, or that ended with a condition code that is redefined using the ON and DO statements, as ENDED NOTOK |
Before exiting the job scheduling definition, return and define one more OUT condition.
IDJOB5-END-NOTOK ODAT -
If the job fails, and then successfully finishes following restart, this OUT condition deletes the DO COND condition that was added by the job failure. If the job does not fail, there is no IDJOB5-END-NOTOK condition to delete. In this case, no deletion occurs and processing continues.
Your job scheduling definition appears as shown in Job Scheduling Definition Figures.
CTM- IDJOB5 RUN FAILED. CORRECT PROBLEM AND RESTART 02.02 12:38 CN(INTERNAL)
The job goes through a process of submission and execution, and finally ends with the status: Ended- Not "OK" Due to CC - Rerun Needed:
The Active Environment screen appears as follows Job Scheduling Definition Figures. If the jobs from the exercises in the preceding chapter have not been deleted by site maintenance, they will also appear in the screen.
Filter: IDGS ------- Control-M Active Environment ------ UP <D> - (3)
COMMAND ===> SCROLL ==> CRSR
O Name Owner Odate Jobname JobID Typ ----------- Status ------------
IDJOB5 ID 020201 M21 /29162 JOB Ended- Not "OK" Due to CC -
Rerun Needed
========= >>>>>>>>>>>>> Bottom of Jobs List <<<<<<<<<<<<< ========
The CC in the status refers to a condition code. You can now review the job log and identify the condition code problem.
Each event in the life cycle of the job appears as a message issued by Control-M. Note the following messages:
Parent Topic |