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

Working With Single Key-Sequenced Files
Working With Files
12–70 106160 Tandem Computers Incorporated
Deleting a Record in Mapped, Unmapped, and Delimited Files
The way that data is organized in a file does not affect how you delete a record in the
file. The following code segment deletes a record in a mapped, unmapped, or
delimited file (the value of the record key is obtained before executing this code
segment):
/* Deletes a record */
&answer = N
SAY "Delete record? (Y/N) Default=N"
CMDLINE "-GO ID="&SYS.NCLID _N
PAUSE VARS=&answer PARSE=NO SEGMENT=1
IF UPPER(&answer) = Y THEN
FILE DEL KEY=&key
Examples of Working With
Single Key-Sequenced
Files
This subsection has four examples of NCL procedures that illustrate how to work with
delimited key-sequenced files. The examples show:
How to add records to a delimited key-sequenced file
How to get records from a delimited key-sequenced file
How to update records in a delimited key-sequenced file
How to delete records in a delimited key-sequenced file
Comments throughout each example describe how it works. You must specify the file
name as the first parameter when you execute each example, for example:
START ZEX1206N $DATA2.JOHNNCLS.DKSUDB
Note Before executing each example, you should use the SHOW UDB command to ensure that DKSUDB is
not being used as a UDB ID at your installation. If it is, edit the examples so that they use a different
UDB ID.