NET/MASTER Network Control Language (NCL) Reference Manual

FILE ADD
Verbs
3–72 106126 Tandem Computers Incorporated
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 ADD verb, as follows:
Return Code Meaning
0 Record added successfully.
4 Record already exists.
8 A file system error occurred during processing. Further information is contained
in the &SYS.FILE.ERROR system variable.
12 Not used.
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 for FILE_ERROR conditions
(the user does not need to code an error handler to ignore such error conditions).
See the core statements ON and RESUME in Section 2, “Core Statements.” The
description of the RESUME core statement contains further information on how to
resume a procedure after an error.
For return codes other than 0 (zero) and 4, the FILE_ERROR condition is signalled.
This condition can be trapped (or intercepted) by an error handler.
See also FILE OPEN, FILE GET, FILE PUT, and FILE SET.
When reading files that are described by user-defined maps, NCL converts data
from an internal to an external format; a conversion takes place in the opposite
direction when such files are written. For more information on user-defined maps
and on the data conversion that occurs when a FILE verb is used to process files
described by user-defined maps, refer to the NonStop NET/MASTER NCL
Programmer's Guide.
For more information on key-sequenced and entry-sequenced files, refer to the
NonStop NET/MASTER NCL Programmer’s Guide.
Example
The following example adds a record to the file with the local identifier HELP. The
variable &USER1 contains the key of the record. The contents of the variables &T, &D,
and &U form the record to be added:
FILE ADD ID=HELP KEY=&USER1 VARS=(&T,&D,&U)