Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

@FILE - Preset file name

&pagelevel(3)&pagelevel

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
type <filename 1..54> or must consist of the special specification '/'.

ver

Version number of the file. If LOCAL is specified then the specification of the
version number has no effect. The version number can be overwritten by
means of an explicit specification in the file access statements.

LOCAL

The specified file name is recorded as the work file-specific file name of the
current work file (explicit local @FILE entry). If string is not specified then
the local @FILE entry is deleted.

If LOCAL is not specified then the specified file name is recorded as the
global @FILE entry. If string is also not specified then the global @FILE
entry is deleted.

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.