File Variables

<file declaration>

── FILE ───────────────────────────────────────────────────────────────►
  ┌◄────────────────────────────── , ─────────────────────────────┐
►─┴─<file identifier>─┬─────────────────────────────────────────┬─┴────┤
                      │     ┌◄───────────── , ────────────┐     │
                      └─ ( ─┴─<file attribute assignment>─┴─ ) ─┘

Explanation

A file declaration defines a logical file with the specified file attributes. A file declared in a WFL job can be used in either of two ways:

  • To enable file attribute inquiries.

    If the declared file is associated with a physical file, the file identifier can be used in expressions that return the values of attributes of the physical file. This subject is discussed in Interrogating File Attributes.

  • To enable a task to use a declared file.

    If a file is declared in a global file assignment, the global file assignment causes a task to use the declared file in place of a file that the task would normally use. This subject is discussed in File Equations.

    WFL cannot directly read from or write to the declared file. However, the file equation capabilities of WFL do provide considerable control over the choice of files that will be used by a task. Refer to File Equations for further details.

Note: File declarations cannot occur in a subroutine.

The WFL job can also include input data for a task, in the form of data specifications. Refer to Global Data Specifications and Local Data Specifications for further details.

File attributes included in a file declaration must be assigned constants or constant expressions. Attributes of type name, file name, or title must be assigned constants only.

The <file attribute assignment> is only associated with the <file identifier> that immediately precedes it.

File attribute values associated with a file variable are not saved across a halt/load. Refer to Job Restart After a Halt/Load for further details.

Note: The use of the file identifier SUMMARY should be avoided for printer files. If a printer file is declared in WFL with a file identifier of SUMMARY, and a job summary is generated with the default title of SUMMARY, the printer file declared in WFL will be lost. This occurs because the job summary file will overwrite the file declared in WFL.

To create a printer file in WFL with the file identifier SUMMARY, either use the JOBSUMMARY task attribute to suppress the job summary, or use the JOBSUMMARYTITLE task attribute to assign a different name to the job summary file.