DELETE (IFILE)
ANSI
The DELETE instruction removes records from the text file and the record's key from the ISAM file.
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
ifile
Required. A previously defined and opened IFILE variable from which the data and the key removed.
key
Optional. A previously defined Character String Variable containing the key of the record.
Flags Affected: OVER
Note the following:
The Logical String of {key} retrieves and then deletes both the text record and associated ISAM key. If the specified key is not found, the OVER Condition Flag is set to TRUE. If {key} is a Null String or not specified, the last ISAM record read in {ifile} is deleted.
Both the entire text record, including logical End Of Record (EOR) mark and the key are deleted. If the text record has already been deleted, only the key is deleted.
Deleted record space on fixed record length files is automatically reused by subsequent WRITE instructions (unless the WEOF parameter was specified for the file).
A DELETE or DELETEK must be performed against each alternate or secondary index file that contains a key for the record.
When deleting from a physical text file having both an ISAM and an AAM key file, the AAM DELETE must be performed first since it requires that the text record be present.
When using the single unlocking mode, a DELETE to a locked record unlocks the record when the operation completes.
See Also: Example Code, WRITE (IFILE), INSERT (IFILE), Disk I/O Instructions
![]() |