── <name constant> ── := ── <file identifier> ─────────────────────────┤
── <identifier> ── := ── <file identifier> ────────────────────────────┤
Explanation
A global file assignment is used to replace a file used by a program with a file declared in the WFL job.
The identifier specified must be the internal name of the file used by the program. The file identifier specified is the identifier that was used in the WFL file declaration.
Example
The following is an example of a global file assignment:
FILE INFILE1 := GLOB2;
The colon (:) before the equal sign (=) is important because if it were left out the statement would be interpreted as a title assignment for the file rather than a global file assignment.
The attribute values of the file that is assigned can be supplied in the file declaration or in later file assignment statements; the system supplies default values for attributes that are not explicitly assigned values in the job.
When a global file assignment replaces a file used by a program, all the attributes associated with the original file are ignored. Therefore, if you want to alter only selected attributes of a file used by a program, a global file assignment should not be used. Instead, use the method described earlier in Changing the Attributes of Files Used by the Task.
Note: | If a global file is used by a COBOL74 program and is used again in the same WFL job, the COBOL74 program cannot close the global file with the LOCK phrase. However, the global file can be closed with the SAVE phrase. The COBOL74 “CLOSE WITH LOCK” statement is specifically implemented for the purposes of preventing access from within the same program/run unit/job once the file has been closed. |
Global file assignments make it possible to find out whether a task has changed any of the attributes of a file. Refer to Interrogating File Attributes for details.
You should be cautious about using global file assignments to cause more than one program to use the same file. Refer to Assigning File Attributes.