NET/MASTER Network Control Language (NCL) Reference Manual
FILE GET
Verbs
3–86 106126 Tandem Computers Incorporated
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.
When you read a record by using FILE GET, the key of the record is normally
extracted from the data and placed in the &SYS.FILE.KEY system variable. The
remaining data is split into the supplied variable or variables. When you access a
file in which the key does not begin in the first byte of the record, it may not be
desirable to extract this key. This is because subsequent manipulation of fields
within the record may inadvertently overwrite the space occupied by this key.
The KEYEXTR operand in the FILE OPEN and FILE SET verbs control whether
this key extraction takes place or not.
See also FILE OPEN and FILE SET. These verbs contain descriptions of the
KEYEXTR operand that determines whether the key is extracted from the record
when using the FILE GET verb.
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 generic retrieval techniques, refer to the NonStop
NET/MASTER NCL Programmer's Guide, which also contains numerous examples
of the use of all file verbs.
Example
The following example starts with a record with the key EGS, and then gets and locks
all records from the file TESTFILE whose keys have the first two characters equal to
the partial key EG (GENLEN=2). It is assumed that the variable &EGS contains the
value EGS and that this verb is included in an NCL iterative loop:
FILE SET ID=TESTFILE KEY=&EGS GENLEN=2
FILE GET ID=TESTFILE OPT=KEQ UPDATE ARGS