The @FILE statement can be used to preset a file name for @GET, @READ, @WRITE, @SAVE, @OPEN (format 2) and @ELIM. It is also possible to predefine a file name that only applies to the current work file (explicit local @FILE entry), or a file name which applies to all the work files (global @FILE entry).
Operation | Operands | F mode, L mode |
@FILE | [string [(ver)]] [LOCAL] |
string | String specifying a file name. The name must correspond to the SDF data |
ver | Version number of the file. If |
LOCAL | The specified file name is recorded as the work file-specific file name of the If |
If there is no explicit local @FILE entry when the statements @READ 'file' or @GET 'file' are executed then the specified file name becomes the local file name (implicit local @FILE entry).
In the case of the @WRITE and @SAVE statements, the file name is searched for first in the statement, then in the explicit local @FILE entry, then in the global @FILE entry and finally in the implicit local @FILE entry.
In the case of the @GET, @READ and @ELIM statements, the file name is searched for first in the statement, then in the explicit local @FILE entry and finally in the global @FILE entry. These statements ignore an implicit local @FILE entry.
In the @OPEN statement (format 2), the file name is first searched for in the statement and then in the global @FILE entry. The @OPEN statement ignores local @FILE entries.
Note
The local @FILE entry is also deleted if the work file is completely deleted with @DELETE (format 2) or @DROP or if a file opened for real processing is closed with @CLOSE.
Example
The file name XMPL.FILE
with the version number * is preset for the following @GET and @SAVE statements. The file XMPL.FILE
is then read in with @GET.
The line range 1 to 2 is deleted in the work file and the content of the work file is then written to the file XMPL.FILE
with @SAVE.