NET/MASTER Network Control Language (NCL) Programmer's Guide
Opening a UDB or UDB Pair for Access by NCL
Working With Files
106160 Tandem Computers Incorporated 12–33
Note By default, when you open a disk file, NCL opens it as a mapped UDB using the map $NCL. By default,
when you open a file that is not a disk file, such as a Guardian process or a spooler, NCL opens it as an
unmapped UDB.
The Structure of an Unmapped UDB
In a UDB where the data is unmapped, NCL treats the data in each record as a
sequence of contiguous bytes. NCL does not interpret the data in an unmapped UDB.
An unmapped UDB can contain any binary data.
Since NCL does not attempt to interpret the data in a record from an unmapped UDB,
the structure of the data in a record is your responsibility. You must control the length
of each field in each record and, therefore, the length of each record. For this reason, it
is usual for the length of each field and, therefore, the length of each record to be of
fixed length. This allows you to apply consistent criteria when reading and writing
records.
The following example opens an unmapped UDB:
FILE OPEN ID=FILEID_1 FORMAT=UNMAPPED
Figure 12-9 shows the structure of a record in a UDB where the data is unmapped.
Figure 12-9. Unmapped UDB Record Structure
Data
033
RECORD KEY
Both entry-sequenced and key-sequenced files can contain unmapped records. It is
most meaningful, however, to open an edit file as an unmapped UDB since NCL has
no control over the structure of the data—NCL can only read records from an edit file.
Figure 12-10 shows four records in an entry-sequenced file where the data is
unmapped. The line above the records shows the position of each character in each
record.
How to read records from an unmapped UDB and write records to an unmapped UDB
is discussed in more detail later in this section.