File variable

A file variable has the attributes FILE and VARIABLE. It cannot have any of the file constant description attributes. File constants can be assigned to file variables. After assignment, a reference to the file variable has the same significance as a reference to the assigned file constant.

The value of a file variable can be transmitted by record-oriented transmission statements. The value of the file variable on the data set might not be valid after transmission.

The VARIABLE attribute is implied under the circumstances described in VARIABLE attribute.

In the following declaration, Account is declared as a file variable, and Acct1 and Acct2 are declared as file constants. The file constants can subsequently be assigned to the file variable.
  declare Account file variable,
    Acct1 file,
    Acc2 file;

For syntax information, see VARIABLE attribute.