NET/MASTER Network Control Language (NCL) Reference Manual

FILE DEL
Verbs
106126 Tandem Computers Incorporated 3–75
FILE DEL The FILE DEL verb deletes a record or a series of records from a key-sequenced file or
pair of files. The FILE DEL verb requires that you already have a current file or pair of
files; if not, you must use the ID operand. You must also have already specified a
current key; if not, you must use the KEY operand.
For key-sequenced files in a pair of files, FILE DEL operates as follows:
If the record is in neither file, the operation fails.
If the record is in the first file but not the second file, the record is deleted from the
first file.
If the record is in the second file but not the first file, a special record is written to
the first file. This marks the record in the second file as being deleted (that is, the
record is logically deleted).
If the record is in both files, a special record replaces the existing record in the first
file. This marks the record in the second file as being deleted (that is, the record is
logically deleted).
A FILE DEL verb can follow a FILE GET verb. The retrieved record is deleted without
the need to respecify the KEY operand.
After generic deletion, in which only a part of the full key is specified, the
&SYS.FILE.RCNT system variable contains the number of records deleted by the FILE
DEL verb. In generic deletion, any record whose key (or the first part of whose key) is
equal to that of the partial key (or greater than that of the partial key, in the case of
KGEALL) is a candidate for deletion.
FILE DEL [ ALTKEY=
altkey
]
[ [ GENLEN=
num
] OPT={ KEQALL | KGEALL } ]
[ ID=
fileid
]
[ KEY=
keydata
]
ALTKEY=
altkey
specifies the two-character identifier that identifies the record's alternate key.
GENLEN=
num
specifies the length of the generic key portion to be used for a generic delete
operation. You can set a current GENLEN value using the FILE SET verb; this is
the value that NCL uses if this operand is omitted. If no current GENLEN value
has been set, and this operand is omitted, then NCL regards the generic key value
to be the whole of the supplied key.