Deletion of a record from VSAM

Hi all,

I have a VSAM file which is the input for a natural program. Under some circumstances, I want to delete the record and process next record. Is there any way to delete records from a file.

Please help me!!!

Thanks in advance.

if you are using Natural VSAM, you would just use the DELETE statement once you have selected the record.

If not, you will have to explain your environment more and what your issue is - how are you accessing the VSAM file?

As Douglas said, you need Natural for VSAM to be able to do this as a FIND or READ of the VSAM with a DELETE inside just like you would for ADABAS or DB2.

If you just want those records to be gone once you have completed your process then you could (assuming it is batch) WRITE the records you want to keep to a different WORK file and as a separate step in your JCL replace your old file with this new copy which is minus the ‘deleted’ records.

Thanks for all ur answers. As i am new to Natural so can u explain what is the meaning of “Natural for VSAM”?

What is being referred to here as “Natural for VSAM” is Natural’s interface to VSAM, which enables you to access VSAm files using Natural DML (READ / FIND / DELETE / …)