# Deletion of a record from VSAM

**URL:** <https://techcommunity.softwareag.com/t/deletion-of-a-record-from-vsam/61866>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes, Natural-Database-and-TP-Monitor-Interfaces-on-Mainframes\
**Created:** [January 22, 2007, 9:08pm UTC](https://techcommunity.softwareag.com/t/deletion-of-a-record-from-vsam/61866 "2007-01-22T21:08:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ambooj](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@ambooj](https://techcommunity.softwareag.com/u/ambooj)\
**Post date:** [January 22, 2007, 9:08pm UTC](https://techcommunity.softwareag.com/t/deletion-of-a-record-from-vsam/61866/1 "2007-01-22T21:08:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [January 23, 2007, 10:04am UTC](https://techcommunity.softwareag.com/t/deletion-of-a-record-from-vsam/61866/2 "2007-01-23T10:04:49Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Mick\_Fitzpatrick](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Mick\_Fitzpatrick](https://techcommunity.softwareag.com/u/Mick_Fitzpatrick)\
**Post date:** [January 23, 2007, 10:23pm UTC](https://techcommunity.softwareag.com/t/deletion-of-a-record-from-vsam/61866/3 "2007-01-23T22:23:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ambooj](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@ambooj](https://techcommunity.softwareag.com/u/ambooj)\
**Post date:** [October 5, 2007, 6:22pm UTC](https://techcommunity.softwareag.com/t/deletion-of-a-record-from-vsam/61866/4 "2007-10-05T18:22:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [October 5, 2007, 7:03pm UTC](https://techcommunity.softwareag.com/t/deletion-of-a-record-from-vsam/61866/5 "2007-10-05T19:03:49Z")

</div>

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 / …)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:41pm UTC](https://techcommunity.softwareag.com/t/deletion-of-a-record-from-vsam/61866/6 "2021-04-02T14:41:01Z")

</div>


