# Efficient way to update periodic field?

**URL:** <https://techcommunity.softwareag.com/t/efficient-way-to-update-periodic-field/99653>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [February 7, 2012, 7:53am UTC](https://techcommunity.softwareag.com/t/efficient-way-to-update-periodic-field/99653 "2012-02-07T07:53:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZohebK](https://avatars.discourse-cdn.com/v4/letter/z/41988e/32.png) [@ZohebK](https://techcommunity.softwareag.com/u/ZohebK)\
**Post date:** [February 7, 2012, 7:53am UTC](https://techcommunity.softwareag.com/t/efficient-way-to-update-periodic-field/99653/1 "2012-02-07T07:53:49Z")

</div>

Hi  
I recently had a problem while updating a periodic field, the program running in batch mode took the mainframe down as it filled DATABASE PLOGS . The dba pointed out that since periodic fields in the view are declared as (\*) it holds all the instances of periodic group during an update and when large number of records are updated PLOGS get filled very fast.

The periodic group has 7 fields and the latest record is added as C\* + 1. Is there a way where I can only hold the last instance and update the view. Like reading from 1 view getting the isn and updating using second view. Or any other efficient way of updating the periodic field. I dont want to give a finite number while declaring the view

Please help in this regard

Thanks

---

<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 7, 2012, 8:32am UTC](https://techcommunity.softwareag.com/t/efficient-way-to-update-periodic-field/99653/2 "2012-02-07T08:32:19Z")

</div>

Hi Zoheb Khan!

> [@Zoheb Khan](#):
>
> Is there a way where I can only hold the last instance and update the view.

Interesting question. But I’m afraid there is no simple workaround. Honestly, I got only one idea: Migrate the Periodic Group to a new adabas file.

Matthias

---

<div class="post-metadata">

**Author:** ![ZohebK](https://avatars.discourse-cdn.com/v4/letter/z/41988e/32.png) [@ZohebK](https://techcommunity.softwareag.com/u/ZohebK)\
**Post date:** [February 7, 2012, 9:03am UTC](https://techcommunity.softwareag.com/t/efficient-way-to-update-periodic-field/99653/3 "2012-02-07T09:03:33Z")

</div>

Hi Matthias

Thanks for the quick reply

Yes, new file is an option and I was hoping to avoid that . As a temp fix , the plan is to give a finite number and then change the enitre process by creating a new file

Zoheb

---

<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 7, 2012, 12:15pm UTC](https://techcommunity.softwareag.com/t/efficient-way-to-update-periodic-field/99653/4 "2012-02-07T12:15:28Z")

</div>

Create a view that only has C\*pe

Create a view that looks like:  
1 myview view of file  
2 pe-name (#adder:#adder  
3 pe-field1  
3 pe-field2  
::::  
3 pe-field7

Read the record with the view that has C\*pe.

Move c\*pe to #adder. Add 1 to #adder.

Read the record with myview

UPDATE with myview

Haven’t tried this, but the plog should only show the single occurrence.

steve

---

<div class="post-metadata">

**Author:** ![ZohebK](https://avatars.discourse-cdn.com/v4/letter/z/41988e/32.png) [@ZohebK](https://techcommunity.softwareag.com/u/ZohebK)\
**Post date:** [February 7, 2012, 1:35pm UTC](https://techcommunity.softwareag.com/t/efficient-way-to-update-periodic-field/99653/5 "2012-02-07T13:35:17Z")

</div>

Hi Steve,

Thanks a lot for this.

I have manged to get this running .

Few points to note :

Myview was declared as suggested by you . i took #adder = C\*pe + 1 and did a GET on Myview. I noticed in the debugger that index value for myview was shown as pe.field(1) with blank values even though value of the #adder = 2.

During update the statement myview.pe(#adder) := ‘value’ didn’t work and was showing an index error. Since the debugger showed index field for myview as (1) i tried this

#next :=1  
move C\*.1stView + 1 to #adder  
Get myview  
myview.pe1(#next) := ‘Value’  
update myview

It worked perfectly. I am still testing to find if it fails but it looks all well.

What i still don’t understand is why the myview had index (1) for the view eventhough #adder was 2?

Zoheb

---

<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:01pm UTC](https://techcommunity.softwareag.com/t/efficient-way-to-update-periodic-field/99653/6 "2021-04-02T15:01:31Z")

</div>


