RECOVERY
Purpose
This statement defines the options to run IBM Workload Scheduler recovery for a job whose status is in
error, but whose error code is not
FAIL. To run the recovery you can specify one or
both of the following recovery actions: - A recovery job (
JOBCMDorJOBSCRkeywords) - A recovery prompt (
MESSAGEkeyword)
OPTION keyword), stop, continue, or rerun. The default is stop with no recovery job
and no recovery prompt. For more information about recovery in a distributed network, see IBM Workload Scheduler: User's Guide and Reference. The RECOVERY
statement is ignored if it is used with a job that runs a centralized script.Format
Parameters
- OPTION(STOP|CONTINUE|RERUN)
- Specifies the option that IBM Z Workload Scheduler must
use when a job abends. You can define a recovery option for every
job. You can specify one of the following values:
- STOP
- Do not continue with the next job. The current job remains in
error. You cannot specify this option if you use the
MESSAGErecovery action. - CONTINUE
- Continue with the next job. The current job status changes to complete in the z/OS® interface.
- RERUN
- Automatically rerun the job (once only). The job status changes to ready, and then to the status of the rerun. Before rerunning the job for a second time, an automatically generated recovery prompt is displayed.
- MESSAGE("message")
- Specifies the text of a recovery prompt,
enclosed in single or double quotation marks, to be displayed if the
job abends. The text can contain up to 64 characters. If the text
begins with a colon (:), the prompt is displayed, but no reply is
required to continue processing. If the text begins with an exclamation
mark (!), the prompt is not displayed, but a reply is required to
proceed. You cannot use the recovery prompt if you specify the recovery
STOPoption without using a recovery job. - JOBCMD(command name)
- Specifies the name of the shell command to run if the job abends. The maximum length is 4095 characters. If the command includes more than one word, it must be enclosed within single or double quotation marks.
- JOBSCR(script name)
- Specifies the name of the shell script or executable file to be run if the job abends. The maximum length is 4095 characters. If the script includes more than one word, it must be enclosed within single or double quotation marks.
- JOBUSR(user name)
- Specifies the name of the user submitting
the recovery job action. The maximum length is 47 characters. If you
do not specify this keyword, the user defined in the
JOBUSRkeyword of theJOBRECstatement is used. Otherwise the user defined in theCPUUSERkeyword of theCPURECstatement is used. TheCPURECstatement is the one related to the workstation on which the recovery job must run. If the user is not specified in theCPUUSERkeyword, the tws user is used.If you use this keyword to specify the name of the user that runs the recovery on a Windows™ fault-tolerant workstation, you must associate this user name to the Windows™ workstation in the
USRRECinitialization statement - JOBWS(workstation name)
- Specifies the name of the workstation on which the recovery job or command is submitted. The maximum length is four characters. The workstation must belong to the same domain as the workstation on which the main job runs. If you do not specify this keyword, the workstation name of the main job is used.
- INTRACTV(YES|NO)
- Specifies that the recovery job runs interactively on a Windows™ desktop. This keyword is used only for jobs running on Windows™ fault-tolerant workstations.
- RCCONDSUC("success condition")
- An expression which determines the
return code (RC) required to consider a recovery job as successful.
If you do not specify this keyword, a return code of zero corresponds
to a successful condition. A return code different from zero corresponds
to the job abending.
The success condition maximum length is 256 characters and the total length of the
JOBCMDorJOBSCRplus the success condition must be 4086 characters. This is because theTWSRCMAPstring is inserted between the success condition and the script or command name. For example, the dir command together with the success condition"rc4"is translated intodir TWSRCMAP: RC4.The success condition expression can contain a combination of comparison and Boolean expressions:
- Comparison expression
- Specifies the recovery job return codes. The syntax is:
(RC operator operand)- RC
- The RC keyword.
- operator
- Comparison operator. It can have the following values:
Table 1. Comparison operators Example Operator Description RC<a < Less than RC<=a <= Less than or equal to RC>a > Greater than RC>=a >= Greater than or equal to RC=a = Equal to RC=a = Not equal to - operand
- An integer between -2147483647 and 2147483647.
RCCONDSUC "(RC = 3)" - Boolean expression
- Specifies a logical combination of comparison expressions. The
syntax is:
comparison_expression operator comparison_expression- comparison_expression
- The expression is evaluated from left to right. You can use parentheses to assign a priority to the expression evaluation.
- operator
- Logical operator. It can have the following values:
Table 2. Logical operators Example Operator Result expr_a and expr_b And TRUE if both expr_a and expr_b are TRUE. expr_a or expr_b Or TRUE if either expr_a or expr_b is TRUE. Not expr_a Not TRUE if expr_a is not TRUE.
RCCONDSUC "(RC=3) OR ((RC5) AND (RC10))"