# Natural using Stack -\> how to read and delete an entry

**URL:** <https://techcommunity.softwareag.com/t/natural-using-stack-how-to-read-and-delete-an-entry/196227>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-News-and-General-Topics\
**Created:** [September 1, 2017, 2:46pm UTC](https://techcommunity.softwareag.com/t/natural-using-stack-how-to-read-and-delete-an-entry/196227 "2017-09-01T14:46:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Javier\_Gonzalez2](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/javier_gonzalez2/32/6988_2.png) [@Javier\_Gonzalez2](https://techcommunity.softwareag.com/u/Javier_Gonzalez2)\
**Post date:** [September 1, 2017, 2:46pm UTC](https://techcommunity.softwareag.com/t/natural-using-stack-how-to-read-and-delete-an-entry/196227/1 "2017-09-01T14:46:00Z")

</div>

Hi, there.  
I like programming using stack.  
I want to read stack and, depending of the entry value, delete it.  
I have found terminal commands documentation such as %.P and %.S.  
Unfortunately, I haven´t found any example about it.  
Please, do you know how to use stack to read or delete an entry ?  
Thank you.

---

<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:** [September 2, 2017, 1:29am UTC](https://techcommunity.softwareag.com/t/natural-using-stack-how-to-read-and-delete-an-entry/196227/2 "2017-09-02T01:29:47Z")

</div>

take a look at the SET CONTROL statement.

Once you issue SET CONTROL ‘%.S’, you use an INPUT statement to read the contents (you can use \*DATA to see how many elements there are). Issue the SET CONTROL ‘%.P’ to delete the next entry on the stack (which, if you have just used ‘%.S’, will be the entry you just read).

---

<div class="post-metadata">

**Author:** ![Javier\_Gonzalez2](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/javier_gonzalez2/32/6988_2.png) [@Javier\_Gonzalez2](https://techcommunity.softwareag.com/u/Javier_Gonzalez2)\
**Post date:** [September 2, 2017, 8:30pm UTC](https://techcommunity.softwareag.com/t/natural-using-stack-how-to-read-and-delete-an-entry/196227/3 "2017-09-02T20:30:36Z")

</div>

Thank you Douglas for your detailed response.

---

<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, 3:39pm UTC](https://techcommunity.softwareag.com/t/natural-using-stack-how-to-read-and-delete-an-entry/196227/4 "2021-04-02T15:39:13Z")

</div>


