NET/MASTER Network Control Language (NCL) Programmer's Guide

Working With Entry-Sequenced Files
Working With Files
106160 Tandem Computers Incorporated 12–49
Table 12-3. Options That Specify Retrieval Direction
Option Meaning
BWD Retrieves the previous record—either the previous physical record in an
entry-sequenced UDB or the previous logical record in a key-sequenced UDB.
This terminates generic retrieval (in key-sequenced UDBs).
FWD Retrieves the following record—either the following physical record in an
entry-sequenced UDB or the following logical record in a key-sequenced UDB.
This terminates generic retrieval (in key-sequenced UDBs).
SEQ Retrieves the next record in the current direction (either backward or forward).
This terminates generic retrieval (in key-sequenced UDBs).
Note Generic retrieval is discussed in more detail later in this section.
Getting a Record From a Mapped Entry-Sequenced File
The options available to you to get a record from a mapped entry-sequenced file
depend on the map used to interpret the data in the file. Regardless of the map used,
you do not have to create an MDO variable (using the ASSIGN verb) before getting a
record from a file. The FILE GET verb automatically creates an MDO variable using
the current map, that is, the map specified using the MAP operand on either the FILE
OPEN or FILE SET verb.
Mapped Using $NCL. If the data is mapped using the map $NCL, then you have two
options to get a record from a file.
Using the first option to get a record from a file mapped by $NCL, the FILE GET verb
gets a record and places each field directly into ordinary variables. Mapping Services
automatically splits the record into fields, which are placed into consecutive variables,
using the length criteria contained in the record. The following example places each
field of a record into the ordinary variables &1 through &n, where n is the number of
the last variable created:
FILE GET ARGS
Using the second option to get a record from a file mapped by $NCL, the FILE GET
verb gets a record and places it directly into an MDO variable. The following example
uses the FILE GET verb to get a record and place it in the MDO variable &MYVAR.:
FILE GET MDO=&myvar.
After getting the record in the MDO variable, you can then transfer the data to
ordinary variables, if you wish. The following example assigns data from the MDO
variable &MYVAR. to the ordinary variables &1 through &n, where n is the number of
the last variable created:
ASSIGN OPT=VALUE ARGS FROM MDO=&myvar.