10.14.3 Delete a Record (DELETE)

Syntax

DELETE [FROM] fname ;

Fname is an internal file name declared earlier.

Purpose

DELETE will remove the current record from fname. A current record is defined as the last record read or added to the data file. Once removed, the data record is no longer available to any other program using the RMS file system. Any errors that occurred during the deletion may be found by calling the ERROR function.

Example:

/* set current record */

FIND IN mag WHERE magazine EQ "rd"

DELETE FROM mag;

IF ERROR (mag) THEN

PRINT "Can't delete magazine: rd",

NL;

Notes

A report program that includes this statement causes the referenced file to be locked when the report begins. The file stays locked until the report completes.