DELETED


 

The DELETED instruction removes duplicate ISAM keys from a key file and their associated text records from the text file. A successful ISAM READ instruction must have previously placed the ISAM key file pointer at the correct duplicate ISAM key, since DELETED deletes the ISAM key and associated text record at the current ISAM key file pointer location. The instruction uses the following format:

 

 

[label]

DELETED

{ifile},{key}

 

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

Required. A previously defined Character String Variable containing the key of the record.

Flags Affected: OVER

Note the following:

  1. The Logical String of {key} verifies 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, the last ISAM record read in {ifile} is deleted.

  2. 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.

  3. Deleted record space on fixed record length files is automatically reused by subsequent WRITE instructions (unless the WEOF parameter is in effect for the file).

  4. A DELETED or DELETEDK must be performed against each alternate or secondary index file that contains a key for the record.

  5. 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.

 

 

See Also: Example Code, WRITE (IFILE), INSERT (IFILE), Disk I/O Instructions

 



PL/B Language Reference DELETE (IFILE) DELETEDK