NET/MASTER Network Control Language (NCL) Reference Manual
FILE OPEN
Verbs
106126 Tandem Computers Incorporated 3–89
It is sometimes necessary to refer to the same file, or pair of files, with different
local file identifiers. You can specify multiple local identifiers by using the ID
operand in multiple FILE OPEN verbs. If you omit the UDBID operand, NCL
operates as if the ID operand specifies both the system-wide and local file
identifier.
Considerations
The &SYS.FILE.RC system variable reflects the result of all file operations within
NCL. NCL sets this variable on completion of the FILE OPEN verb, as follows:
Return Code Meaning
0 File or first file in a pair of files opened for read-only access.
4 File or first file in a pair of files opened for read and write, but not delete, access.
8 File or first file in a pair of files opened for read, write, and delete access.
12 File or first file in a pair of files inaccessible.
16 An error occurred. Further information is contained in &SYSMSG.
It is the user’s responsibility to test the &SYS.FILE.RC system variable for errors.
There is an implicit resumption of the NCL procedure after any errors, unless the
user has coded an error handler for the FILE_ERROR condition. See the core
statements ON and RESUME in Section 2, “Core Statements.”
For return code 16, the FILE_ERROR condition is signalled. This condition can be
trapped (or intercepted) by an error handler.
For more information on user-defined maps, refer to the NonStop NET/MASTER
NCL Programmer's Guide.
For more information on mapped, unmapped, and delimited file formats, refer to
the NonStop NET/MASTER NCL Programmer's Guide, which also contains examples
of the FILE OPEN and other file verbs.
See FILE SET, which describes the operands you can use to change the attributes
of the current file. In particular, like the FILE OPEN verb, it allows you to specify
the key extraction KEYEXTR operand.
Example
The following example opens the file with the local file identifier TESTFILE as an
unmapped file:
FILE OPEN ID=TESTFILE FORMAT=UNMAPPED