VSAM - Deleting records from a VSAM file - www.cadcobol.com.br



Desenvolvido por DORNELLES Carlos Alberto - Analista de Sistemas - Brasília DF. - cad_cobol@hotmail.com

Deleting records from a VSAM file

Enterprise COBOL for z/OS, Version 4.2, Programming Guide


To remove an existing record from an indexed or relative file, open the file I-O and use the DELETE statement.
You cannot use DELETE on a sequential file.

When you use ACCESS IS SEQUENTIAL or the file contains spanned records, your program must first read the record to be deleted.
The DELETE then removes the record that was read.
If the DELETE is not preceded by a successful READ, the deletion is not done and the status key value is set to 92.

When you use ACCESS IS RANDOM or ACCESS IS DYNAMIC, your program does not have to first read the record to be deleted.
To delete a record, move the key of the record to be deleted to the RECORD KEY data item, and then issue the DELETE.
Your program should check the file status key after each DELETE statement.



© Copyright IBM Corp.