NET/MASTER Network Control Language (NCL) Programmer's Guide
Working With Entry-Sequenced Files
Working With Files
106160 Tandem Computers Incorporated 12–45
Adding a Record to a Mapped Entry-Sequenced File
The options available to you to add a record to a mapped entry-sequenced file depend
on the map used to interpret the data in the file.
Mapped Using $NCL. If the data is mapped using the map $NCL, then you have two
options to add data to a file. Using the first option to add data to a file mapped by
$NCL, you do not have to create an MDO variable that contains the data before adding
the data to a file. The first option is outlined in the following steps:
1. Obtain the data in ordinary variables. The following example uses the CMDLINE
and PAUSE verbs to obtain data in the ordinary variables &ORDINARY*:
…
CMDLINE "GO ID="&SYS.NCLID
PAUSE VARS=&ordinary*
…
2. Use the FILE ADD verb to add the data directly from the ordinary variables to a
file. Mapping Services automatically creates a record that contains the length of
each field and the total length of the record. The following example adds the
ordinary variables &ORDINARY* to a file:
FILE ADD VARS=&ordinary*
Using the second option to add data to a file mapped by $NCL, you must create an
MDO variable to hold the data before adding the data to a file. The second option is
outlined in the following steps:
1. Use the ASSIGN verb to create an MDO variable before obtaining the data. The
following example creates an MDO variable &REC.:
ASSIGN MDO=&rec. MAP=$NCL
2. Obtain the data in ordinary variables. The following example uses the CMDLINE
and PAUSE verbs to obtain data in the ordinary variables &ORDINARY*:
…
CMDLINE "GO ID="&SYS.NCLID
PAUSE VARS=&ordinary*
…
3. Use the ASSIGN verb to transfer the data from ordinary variables to the MDO
variable. The following example transfers data from &ORDINARY* to &REC.:
ASSIGN MDO=&rec. MAP=$NCL FROM VARS=&ordinary*
4. Use the FILE ADD verb to add the data from the MDO variable to a file. The
following example adds the data contained in the MDO variable &REC. to a file:
FILE ADD MDO=&rec.
Mapping Services automatically creates a record that contains the length of each
field and the total length of the record.