DELETE

Purpose

Deletes a record from a DIRECT UPDATE or a KEYED SEQUENTIAL UPDATE file.

Syntax

DELETE FILE(reference)[KEY(e)];

Parameters

reference
Identifies a file value that has been opened with the DIRECT UPDATE or KEYED SEQUENTIAL UPDATE attributes.
e
Any valid key expression.

Description

The DELETE statement deletes a record from a DIRECT UPDATE or a KEYED SEQUENTIAL UPDATE file. For both DIRECT UPDATE and KEYED SEQUENTIAL UPDATE files, the key expression is evaluated and converted to the appropriate form. For an indexed (VSAM) file, the key expression is converted to CHARACTER. For a relative record I/O file, it is converted to a positive integer. For indexed (VSAM) files, if the KEY clause is omitted, the last record read is deleted. The KEY clause is required for relative record I/O files. If a record with that key does not exist, the KEY condition is signaled. Return from a KEY condition ON-unit resumes execution with the statement following the DELETE statement. (For more information on record I/O, see the section Input and Output in the chapter Language Concepts.)

Example

DELETE FILE(F) KEY('203XJ42');

Restrictions

None.