JOBREC

Purpose

This statement defines the fault-tolerant workstation job properties. You must specify JOBREC for each member of the SCRPTLIB. For each job this statement specifies the script or the command to run and the user that must run the script or command.

Format


1  JOBREC
1  JOBCMD  ( command name )
1  JOBSCR  ( script name )
2?  JOBUSR (  user name )
2?  INTRACTV (
3.1! NO
3.1 YES
2 )
2?  RCCONDSUC (  "success condition" )

Parameters

JOBSCR(script name)
Specifies the name of the shell script or executable file to run for the job. The maximum length is 4095 characters. If the script includes more than one word, it must be enclosed within single or double quotation marks. Do not specify this keyword if the job uses a centralized script.
JOBCMD(command name)
Specifies the name of the shell command to run the job. The maximum length is 4095 characters. If the command includes more than one word, it must be enclosed within single or double quotation marks. Do not specify this keyword if the job uses a centralized script.
JOBUSR(user name)
Specifies the name of the user submitting the specified script or command. The maximum length is 47 characters. If you do not specify the user in the JOBUSR keyword, the user defined in the CPUUSER keyword of the CPUREC statement is used. The CPUREC statement is the one related to the workstation on which the specified script or command must run. If the user is not specified in the CPUUSER keyword, the tws user is used.

If the script is centralized, you can also use the job-submit exit (EQQUX001) to specify the user name. This user name overrides the value specified in the JOBUSR keyword. In turn, the value specified in the JOBUSR keyword overrides that specified in the CPUUSER keyword of the CPUREC statement. If no user name is specified, the tws user is used.

If you use this keyword to specify the name of the user who submits the specified script or command on a Windows fault-tolerant workstation, you must associate this user name to the Windows workstation in the USRREC initialization statement.

INTRACTV(YES|NO)
Specifies that a Windows job runs interactively on the 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 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 JOBCMD or JOBSCR plus the success condition must be 4086 characters. This is because the TWSRCMAP string is inserted between the success condition and the script or command name. For example the dir command together with the success condition "rc<4" is translated into dir TWSRCMAP: RC<4.

The success condition expression can contain a combination of comparison and Boolean expressions:

Comparison expression
Specifies the 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.
For example, you can define a successful job as a job that ends with a return code less than or equal to 3 as follows:
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.
For example, you can define a successful job as a job that ends with a return code less than or equal to 3 or with a return code not equal to 5, and less than 10 as follows:
RCCONDSUC "(RC<=3) OR ((RC<>5) AND (RC<10))"