NET/MASTER Network Control Language (NCL) Programmer's Guide
Opening a UDB or UDB Pair for Access by NCL
Working With Files
12–30 106160 Tandem Computers Incorporated
The following examples open mapped UDBs using the maps $NCL, $MSG, $SEC
(standard maps), and MYMAP (a user-defined map), respectively:
FILE OPEN ID=FILEID_1 FORMAT=MAPPED MAP=$NCL
FILE OPEN ID=FILEID_1 FORMAT=MAPPED MAP=$MSG
FILE OPEN ID=FILEID_1 FORMAT=MAPPED MAP=$SEC
FILE OPEN ID=FILEID_1 FORMAT=MAPPED MAP=MYMAP
Figure 12-6 shows the structure of a record in a UDB where the data is mapped and the
map is $NCL.
Figure 12-6. Mapped UDB Record Structure
'0000'XField length Data
Record LengthRECORD KEY '001D'X
'0000'XField length Data
'0000'XField length Data
'0000'XField length Data
030
Figure 12-6 shows that the record has, as usual, a record key. This is followed by the
length field of the record and the key field of the record. The key field contains the
hexadecimal characters '001D', which correspond to the symbolic name DATALIST in
an MDO variable.
The value of the record length is the length of the whole record (in bytes). The length
excludes the length of the record key. It includes its own length (two bytes) and the
length of the hexadecimal characters ‘001D’ (two bytes).
Figure 12-6 shows that all other elements in the record consists of three parts: the field
length, which contains the length of the element; the hexadecimal characters ‘0000’,
which correspond to the symbolic name DATA in an MDO variable; and the data
itself.
Both entry-sequenced and key-sequenced files can contain mapped records. It is not
meaningful, however, to open an edit file as a mapped UDB since NCL has no control
over the structure of the data—NCL can only read records from an edit file.
Figure 12-7 shows four records in a mapped entry-sequenced file where the map is
$NCL. Figure 12-8 shows four records in mapped key-sequenced file where the map is
$NCL.