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

User-Defined Maps
Standard and User-Defined Maps
11–42 106160 Tandem Computers Incorporated
The following steps show what you should do to work with a file that you create
using DDL using its corresponding map:
1. Assign a key for the key-sequenced file as part of the RECORD clause, for
example:
DEF empdef
02 empcode PIC 9(4).
END
RECORD emprec.
FILE IS "$DATA2.UDDL.EMPFILE" KEY-SEQUENCED.
DEF IS empdef.
KEY IS emprec.empcode.
END
2. Create the map, add to the map file, create the key-sequenced file, and open
the key-sequenced file for access by NonStop NET/MASTER MS, for example:
UDBCTL OPEN=$DATA2.U DDL.EMPFILE ID=EMPFILE
3. Open the file from an NCL process, specifying KEYEXTR=NO, for example:
FILE OPEN FORMAT=MAPPED MAP=EMPREC ID=EMPFILE KEYEXTR=NO
When you are creating a record to write to the file, you should follow these steps:
1. Create the MDO variable that is to contain the record by using the ASSIGN
verb with the specified map, for example:
ASSIGN MDO=&addmdo. MAP=EMPREC
2. Assign data to the fields in the MDO variable, for example:
&addmdo.empname.lastname = Smith
&addmdo.empname.firstname = John
&addmdo.empname.midinit = ABC
&addmdo.empaddr.street = 99 Spring St
&addmdo.empaddr.city = Mycity
&addmdo.empaddr.state = Mystate
&addmdo.empaddr.zip = 12345
3. Assign the value of the record key to the MDO variable that corresponds to
the key you defined using DDL, for example:
&addmdo.empcode = 7777
4. Specify this MDO variable as the value of the key on the FILE ADD or FILE
PUT verb, for example:
FILE PUT MDO=&addmdo. KEY=&addmdo.empcode
The value of &SYS.FILE.KEY also has the value specified by this variable. In this
example, the value of &SYS.FILE.KEY is 7777.