MYJOB and MYSELF are predeclared task variables that can be used to assign or interrogate task attribute values. The MYJOB task variable is always assigned to the job itself. If the MYJOB task variable is used in a task assignment statement, the values specified for it are assigned to the job.
The syntax that applies to declared task variables can be used with the predeclared task variables MYJOB and MYSELF, except for the specific cases documented in “Task State” under Boolean Expressions.
Examples
For example, the following statement assigns a value to the FAMILY attribute of the job:
MYJOB(FAMILY DISK = MYPACK ONLY);
Any task attributes you wish to specify for the job will normally be included at the start of the job in the job attribute list. Thus, a task assignment statement using MYJOB is most useful when you want to change the job attributes later in the job.
The following example uses MYJOB in a task attribute inquiry:
RUN SKYVAL; STATION = MYJOB(SOURCESTATION);
This example takes the value of the SOURCESTATION attribute of the job and assigns it to the STATION attribute of a task.
The following statement assigns a value to the BDNAME attribute, so that backup files are created under the directory MYBACKUPFILES:
MYJOB(BDNAME = MYBACKUPFILES);
BDNAME can also be reset by equating it to an empty string (or a string expression that has the value of an empty string).
In an asynchronous subroutine, the MYSELF task variable is associated with that subroutine; otherwise, it is assigned to the job and is synonymous with MYJOB. For example, the following statement stores the value of the MIXNUMBER attribute of the asynchronous subroutine or job in the variable I:
I := MYSELF(MIXNUMBER);
The following statement assigns the value 9 to the TASKVALUE attribute of the asynchronous subroutine or job:
MYSELF(TASKVALUE = 9);
These predeclared task variables lose their special meaning if they are explicitly declared in a job.