── CURRENTDIRECTORY ── = ─┬─ <absolute pathname> ─┬────────────────────┤ └─ <relative pathname> ─┘
Refer to the Task Attributes Programming Reference Manual for the definition of absolute and relative path names.
Explanation
The CURRENTDIRECTORY attribute specifies the directory that is the starting point for resolution of relative path names. It contains a character string, in path name format, which is prefixed to a file name during such operations as opening or searching for a file when the file name is relative and the SEARCHRULE attribute of the file is POSIX.
If the string that assigns the CURRENTDIRECTORY attribute represents a relative path name, the string is prefixed by the current value of the attribute, and the attribute is set from the combined string. Setting the CURRENTDIRECTORY attribute to a relative path name is permitted only on an active task and only by the associated process.
If the CURRENTDIRECTORY attribute is not explicitly specified on the task variable or code file, the attribute is inherited from the parent task if the parent task's CURRENTDIRECTORY attribute is set. Otherwise, the attribute defaults to a null string.
If a WFL job contains a USERCODE assignment in the job header, but does not contain a CURRENTDIRECTORY assignment, the job's CURRENTDIRECTORY attribute is set to the POSIXINITDIR (POSIX Initial Directory) value from the USERDATAFILE.
Examples
The CURRENTDIRECTORY of the job is set from the USERDATAFILE. PROG1 runs with the value. PROG2 runs with a value of "/-/NEWFAM/USERCODE/MYUC/DIR1", which references the directory (MYUC)DIR1 ON NEWFAM.
BEGIN JOB; USER=MYUC/MYPW; RUN PROG1; RUN PROG2; CURRENTDIRECTORY="/-/NEWFAM/USERCODE/MYUC/DIR1"; END JOB.
In the following example, PROG3 runs with a CURRENTDIRECTORY value of "/A/B/C", which references the directory *A/B/C on the family specified as the root family by the DL ROOT command:
BEGIN JOB; CURRENTDIRECTORY="/A/B"; MYSELF(CURRENTDIRECTORY="C"); RUN PROG3; END JOB.