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

Working With Single Key-Sequenced Files
Working With Files
12–58 106160 Tandem Computers Incorporated
Opening the File for Access
by NonStop NET/MASTER
MS
The UDBCTL OPEN command opens a key-sequenced file for access by NonStop
NET/MASTER MS. The following code segment uses the INTCMD verb to execute
the UDBCTL OPEN command from an NCL process:
SAY "Opening "&filename
INTCMD "UDBCTL OPEN="&filename" ID="&id
INTREAD
Opening the File for Access
by NCL
The FILE OPEN verb opens a key-sequenced file for access by NCL. You can open a
key-sequenced file as mapped, unmapped, or delimited.
Opening a Mapped Key-Sequenced File
The following code segment opens a previously created key-sequenced file as mapped
using the map $NCL:
FILE OPEN ID=&id FORMAT=MAPPED MAP=$NCL
You can also open a file as mapped by using $MSG, $SEC, or the name of a
user-defined map.
Opening an Unmapped Key-Sequenced File
The following code segment opens a previously created key-sequenced file as
unmapped:
FILE OPEN ID=&id FORMAT=UNMAPPED
Opening a Delimited Key-Sequenced File
The following code segment opens a previously created key-sequenced file as
delimited:
FILE OPEN ID=&id FORMAT=DELIMITED
Adding a Record The FILE ADD and FILE PUT verbs add a new record to a key-sequenced file. You
can use either verb to add records to mapped, unmapped, and delimited
key-sequenced files. When you add a record to a key-sequenced file, the record is
added logically to the position specified by the key. You must specify the value of the
record key, using the KEY operand, either before adding the record, using the FILE
SET verb, or when you add the record, using either the FILE ADD or FILE PUT verb.
Note See the discussion on adding a record to an entry-sequenced file earlier in this section for information on
how to construct a record before adding the record to a file.