DELETE (AFILE)
ANSI
The DELETE instruction removes records from a text file and keys from the AAM file.
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
afile
Required. A previously defined and opened AFILE variable from which the data and the key removed.
Flags Affected: NONE
Note the following:
The last AAM record accessed through an AAM READ instruction is deleted. If a successful AAM READ instruction was not previously performed, an I/O error occurs.
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 is in effect for this file).
A DELETE must be performed against each alternate or secondary index file that contains keys.
When deleting from a physical text file having both an ISAM and an AAM key file, the AAM DELETE should 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 (AFILE), Disk I/O Instructions
![]() |