NET/MASTER Network Control Language (NCL) Programmer's Guide
Working With Entry-Sequenced Files
Working With Files
12–46 106160 Tandem Computers Incorporated
Mapped Using a Map Other Than $NCL. If the data is mapped using a map other than
$NCL (such as $MSG, $SEC, or a user-defined map) then you have two options to add
the data to a file. The first option applies when an MDO variable is automatically
created by NonStop NET/MASTER MS, for example, after an EMSREAD, INTREAD,
LOGREAD, or MSGREAD verb reads a message or a SECCALL GET verb retrieves a
record from the User ID Management Services (UMS) database. In neither case do you
have to create an MDO variable before adding data to a file.
In the following code segment, for example, when the MSGREAD verb reads a
message, it automatically creates the MDO variable &$MSG., which is mapped using
the map $MSG:
…
MSGREAD
FILE ADD MDO=&$msg.
…
The FILE ADD verb directly adds the data from the MDO variable to a mapped file.
In the following code segment, when the SECCALL GET verb reads a message, it
automatically creates the MDO variable &SEC., which is mapped using the map $SEC:
…
SECCALL GET MDO=&sec.
FILE ADD MDO=&sec.
…
The FILE ADD verb directly adds the data from the MDO variable to a mapped file.
The second option applies if you want to add data in an MDO variable that you create
yourself. The second option is outlined in the following steps:
1. Before obtaining the data, use the ASSIGN verb to create an MDO variable using
the appropriate map. The following code segment creates an MDO variable
&MYVAR. mapped using the map $MSG:
ASSIGN MDO=&myvar. MAP=$MSG
2. Obtain the data in variables that Mapping Services can interpret using the map.
The following code segment uses a series of assignment statements to explicitly
assign values to fields in the MDO variable &MYVAR.:
…
&myvar.TEXT = This is text
&myvar.MSGATTR.DISPLAY.COLOR = RED
&myvar.MSGATTR.DISPLAY.HLITE = BLINK
&myvar.MSGATTR.DISPLAY.INTENS = HIGH
…
3. Use the FILE ADD verb to add the data from the MDO variable to the file. The
following example adds the data contained in the MDO variable &MYVAR. to a
file:
FILE ADD MDO=&myvar.