# Deleting the separate or last item of the periodic group

**URL:** <https://techcommunity.softwareag.com/t/deleting-the-separate-or-last-item-of-the-periodic-group/174389>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux\
**Created:** [February 11, 2014, 7:51am UTC](https://techcommunity.softwareag.com/t/deleting-the-separate-or-last-item-of-the-periodic-group/174389 "2014-02-11T07:51:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Andreev1](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@Alexander\_Andreev1](https://techcommunity.softwareag.com/u/Alexander_Andreev1)\
**Post date:** [February 11, 2014, 7:51am UTC](https://techcommunity.softwareag.com/t/deleting-the-separate-or-last-item-of-the-periodic-group/174389/1 "2014-02-11T07:51:36Z")

</div>

Hello!

How I can delete the separate or last item of the periodic group?

e.g. DELETE PER\_GR(3)

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [February 11, 2014, 8:34am UTC](https://techcommunity.softwareag.com/t/deleting-the-separate-or-last-item-of-the-periodic-group/174389/2 "2014-02-11T08:34:17Z")

</div>

reset PER\_GR(3)

---

<div class="post-metadata">

**Author:** ![Alexander\_Andreev1](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@Alexander\_Andreev1](https://techcommunity.softwareag.com/u/Alexander_Andreev1)\
**Post date:** [February 11, 2014, 8:50am UTC](https://techcommunity.softwareag.com/t/deleting-the-separate-or-last-item-of-the-periodic-group/174389/3 "2014-02-11T08:50:41Z")

</div>

Thank you for your reply, Matthias! But this not work.  
After this actions I must get the C\*GBCH statement one less than the initial value, but this not happened.

Here is code:

```auto
FIND SPRK KSPR=906 AND KREK=3185
RESET PER_GR(5)
display KREK C*PER_GR
loop
END OF TRANSACTION
END 
```

Regards,

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [February 11, 2014, 11:41am UTC](https://techcommunity.softwareag.com/t/deleting-the-separate-or-last-item-of-the-periodic-group/174389/4 "2014-02-11T11:41:50Z")

</div>

What your little code snippet does is change the value in memory. It does NOT change the record until you do an UPDATE statement. Even then, you would have to re-acquire the record (say with a GET) in order to change C\*

---

<div class="post-metadata">

**Author:** ![Alexander\_Andreev1](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@Alexander\_Andreev1](https://techcommunity.softwareag.com/u/Alexander_Andreev1)\
**Post date:** [February 11, 2014, 12:16pm UTC](https://techcommunity.softwareag.com/t/deleting-the-separate-or-last-item-of-the-periodic-group/174389/5 "2014-02-11T12:16:00Z")

</div>

Thanks, Steve. I know that I need to use UPDATE, but I don’t know what assign to PER\_GR(5).

```auto
FIND SPRK KSPR=906 AND KREK=3185  
  UPDATE(0010) SET PER_GR(5)=/*What is here??? 
loop  
END OF TRANSACTION  
END   
```

Could you attach the little code snippet please?

Thanks in advance!

---

<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:** [February 11, 2014, 12:20pm UTC](https://techcommunity.softwareag.com/t/deleting-the-separate-or-last-item-of-the-periodic-group/174389/6 "2014-02-11T12:20:16Z")

</div>

RESET does what the name implies, it resets the variable(s) to their initial value, thus they will be compressed away when you UPDATE.

---

<div class="post-metadata">

**Author:** ![Alexander\_Andreev1](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@Alexander\_Andreev1](https://techcommunity.softwareag.com/u/Alexander_Andreev1)\
**Post date:** [February 11, 2014, 1:35pm UTC](https://techcommunity.softwareag.com/t/deleting-the-separate-or-last-item-of-the-periodic-group/174389/7 "2014-02-11T13:35:28Z")

</div>

My problem: I I have not used a structure mode 🙂  
Switched on it and it worked.

Thanks all!

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [February 11, 2014, 5:45pm UTC](https://techcommunity.softwareag.com/t/deleting-the-separate-or-last-item-of-the-periodic-group/174389/8 "2014-02-11T17:45:23Z")

</div>

Without a GET (or other acquisition of the record), there is no way your code would result in C\* being decremented.

Structured vs Report mode is mainly syntactic; it does not change the way statements function.

---

<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:30pm UTC](https://techcommunity.softwareag.com/t/deleting-the-separate-or-last-item-of-the-periodic-group/174389/9 "2021-04-02T15:30:18Z")

</div>


