Task Attribute Assignment

<task attribute assignment>

──┬─<Boolean task attribute>─┬───────────────────────────────┬─────────┤
  │                          └─ = ──<Boolean expression>─────┤
  ├─<file name task attribute>── = ──<file name>─────────────┤
  ├─<integer name task attribute>── = ──<integer expression>─┤
  ├─<mnemonic task attribute>── = ──<task mnemonic primary>──┤
  ├─<name task attribute>── = ──<name>───────────────────────┤
  ├─<real task attribute>── = ──<real expression>────────────┤
  ├─<string task attribute>── = ──<string expression>────────┤
  ├─<title task attribute>── = ──<file title>────────────────┤
  └─<complex task attribute assignment>──────────────────────┘

Explanation

Task attributes are used to monitor and control the execution of tasks. For details on the meanings and uses of task attributes, refer to the Task Attributes Programming Reference Manual. Task attribute assignments, in general, follow this format:

<attribute name> = <attribute value> 

Each attribute accepts only a particular type of value: Boolean, or integer, for example. In most cases, WFL enables variables and expressions to be used for the attribute value. For string task attributes that can be null, you can set them to a null value by assigning the string "" or ".".

Task attribute assignments can be used in job attribute lists, task declarations, task assignment statements, and task equation lists. Certain restrictions apply to task attribute assignments that occur in task declarations. Refer to Task Variables for more information.

Any task attributes that are not explicitly assigned values in the WFL job receive default values when the task is initiated. These default values come from the following sources:

  • If task attribute values are assigned to an object code file when it is originally compiled, these become the default values whenever that object code file is executed. The task attributes compiled into an object code file can later be permanently changed with the MODIFY statement, without recompiling the source file.

  • Certain task attributes inherit values from the attributes of the job. For example, the USERCODE attribute receives the value of the USERCODE attribute of the job. To determine whether a particular attribute is inherited in this way, refer to the appropriate attribute description in the Task Attributes Programming Reference Manual.

  • Each attribute has a particular default value that is used if it is not overridden by any of the previously mentioned causes. Defaults vary from one attribute to another.

If a particular task attribute is assigned values more than once in a given job attribute list, task declaration, task assignment statement, or task equation list, then the last value specified for the task attribute overrides the previous ones.

The complex task attribute assignments are assignments to task attributes that require a fairly complex value. The syntax for each of these attribute assignments appears in Complex Task Attribute Assignments.

The syntax for the various kinds of expressions referred to in the <task attribute assignment> syntax diagram is provided in Expressions. The following pages describe the syntax used in WFL for assigning values to the various kinds of task attributes.

Examples

Boolean Assignment

If a Boolean-valued attribute occurs in a task attribute assignment without any value specified for it, it is assigned TRUE. Thus, the following two examples are equivalent:

RUN OBJECT/NATTY;             RUN OBJECT/NATTY; 
LOCKED;                       LOCKED = TRUE; 
TADS;                         TADS = TRUE;  

A Boolean attribute can also be assigned the result of various comparisons, as in the following example:

RUN OBJECT/KAYA; 
SW1 = X GEQ Y;                      % Arithmetic comparison 
SW2 = STRING1 EQL STRING2;          % String comparison 
SW3 = INFILE (SECURITY) IS PUBLIC;  % File mnemonic comparison 
SW4 = TVAR(HISTORYCAUSE) 
      IS OPERATORCAUSEV;            % Task mnemonic comparison 
SW5 = B1 OR B2;                     % Boolean expression 

Integer Assignment

The following are examples of integer attribute assignments:

PRIORITY = 50;          % Assigns an integer constant. 
CLASS = X;              % Assigns an integer variable. 
MAXPROCTIME = Y + Z;    % Assigns the value of an integer 
                        % expression. 

The value can also be taken from a task variable defined earlier in the program, if a task variable was associated with that task:

PRIORITY = TVAR1 (PRIORITY); 

Mnemonic Assignment

Mnemonic attribute values can be assigned in one of the following ways.

  • From a direct assignment:

    RUN (WENDY)OBJECT/LPFINDER; 
    FILEACCESSRULE = DEFAULT; 
  • From a previously defined task variable:

    TASKA (FILEACCESSRULE = DECLARER); 
    RUN (WENDY)OBJECT/LPFINDER; 
    FILEACCESSRULE = TASKA (FILEACCESSRULE); 
  • From a string value:

RUN (WENDY)OBJECT/LPFINDER; 
FILEACCESSRULE = #STVAR1;  % STVAR1 is a string variable.

Real Assignment

The following are examples of real attribute assignments:

MAXIOTIME = DECIMAL(STR1);  % STR1 is a string variable.
MAXPROCTIME = X;            % X is a real variable. 

Title Assignment

A title-valued attribute accepts a value that follows the syntax of a file title. This is shown in the following example:

JOBSUMMARYTITLE = (WALLY)NUMB/CALC ON SHIPPK; 

String expressions can also be used in a title assignment:

MYJOB(JOBSUMMARYTITLE = 
       (#STR1)#STR2/#STR3);     % Where STR1, STR2, and STR3
                                % are string variables.
MYJOB(JOBSUMMARYTITLE = #STR4); % Where STR4 contains a
                                % valid file title.