When a task variable is associated with a task, any task attribute assignments or file equations currently assigned to that task variable are assigned to the task.
If a task variable is to be used to assign task or file attribute values to a task, these values can be specified in the task declaration that declares that task variable. (Refer to Declaration Syntax.)
The attribute values associated with the task variable can be added to or changed in any of the following ways:
-
Task assignment statements can be used to associate additional task attribute assignments and file equations with the task variable, or to override values that had been specified for that task variable previously. (Refer to the Assignment Statements for a description of the task assignment statement.)
-
Task attribute assignments in a task assignment statement can be applied in any order, not necessarily in the order listed. If the order is important, the task assignments should be put into separate task assignment statements. Thus, a statement such as the following is undesirable:
TVAR(STATUS=NEVERUSED,FAMILY DISK = PARTS ONLY);
The FAMILY assignment in this example can be executed before the STATUS assignment. If it is, the FAMILY value will be discarded.
-
When the task variable is used in a task initiation statement, and attribute assignments follow the task initiation statement, they are added to the values that are currently assigned to the task variable. Where there is a conflict, the values following the task initiation statement override those currently associated with the task variable.
-
When the task variable is used in a task initiation statement, and the task is a program, any attribute assignments associated with the object code file of the program are added to those currently associated with the task variable. Where there is a conflict, the values currently associated with the task variable override those associated with the object code file.
-
If, at any point in the job, the INITIALIZE statement is used to reinitialize the task variable, then all task and file attributes previously associated with the task variable are discarded. For example, the following statement will reinitialize the task variable TVAR:
INITIALIZE (TVAR);
Examples
In the following example, the program (RAJA)OBJECT/ALT runs with the task and file attributes given for the task variable TVAR in the task declaration:
?BEGIN JOB; TASK TVAR (PRIORITY=50, % Task variable declaration FILE INFILE (TITLE = F/T)); RUN (RAJA)OBJECT/ALT [TVAR]; % Task initiation statement ?END JOB.
The following example shows several ways in which a task variable can be assigned task attribute values:
?BEGIN JOB ATTRIBUTES; TASK T (PRIORITY=50,USERCODE=JAMES/PW, % Task declaration FAMILY DISK = DISK ONLY); RUN (PARTS)PROG [T]; % Task initiation MAXPROCTIME = 90; INITIALIZE (T); % Initialize statement T (MAXPROCTIME=30); % Task assignment statement RUN (PARTS)SUMMARY [T]; ?END JOB.