# How do you scan an ADABAS file using Natural?

**URL:** <https://techcommunity.softwareag.com/t/how-do-you-scan-an-adabas-file-using-natural/194367>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [April 27, 2017, 5:47pm UTC](https://techcommunity.softwareag.com/t/how-do-you-scan-an-adabas-file-using-natural/194367 "2017-04-27T17:47:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sandy\_Spencer](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/sandy_spencer/32/1219_2.png) [@Sandy\_Spencer](https://techcommunity.softwareag.com/u/Sandy_Spencer)\
**Post date:** [April 27, 2017, 5:47pm UTC](https://techcommunity.softwareag.com/t/how-do-you-scan-an-adabas-file-using-natural/194367/1 "2017-04-27T17:47:22Z")

</div>

The CLOG shows that a Natural program is issuing over 7 million L1/L4 (Read or Read and Hold Record) commands which is causing the CLOG to fill and require a switch much faster than our system is able to handle. I see hundreds of

ADANC3 00062 2017-04-26 02:34:51 Caution: Command logging has stalled

messages in the MPM log. Fortunately, ADABAS recovered on it’s own and the job completed.

Does anyone have a simple Natural program that would allow the programmer to do an initial read, followed by GET NEXT until the end of the file?

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [April 27, 2017, 6:43pm UTC](https://techcommunity.softwareag.com/t/how-do-you-scan-an-adabas-file-using-natural/194367/2 "2017-04-27T18:43:37Z")

</div>

An L1 is a READ BY ISN or a GET. An L4 is a READ BY ISN WITH HOLD or a GET WITH HOLD. A GET NEXT is an L1 used to process a set if ISNs created by a FIND command. Even if it were possible to FIND 7 million ISNs, the number of Adabas calls would not change.

It might be a common technique that is causing this problem. Check whether the program has a GET nested within the READ, with the UPDATE or DELETE attached to the GET. If so, changing the ET logic to remove the GET would save you one third of the commands.

READ - GET - UPDATE → READ - UPDATE

---

<div class="post-metadata">

**Author:** ![Sandy\_Spencer](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/sandy_spencer/32/1219_2.png) [@Sandy\_Spencer](https://techcommunity.softwareag.com/u/Sandy_Spencer)\
**Post date:** [April 27, 2017, 6:59pm UTC](https://techcommunity.softwareag.com/t/how-do-you-scan-an-adabas-file-using-natural/194367/3 "2017-04-27T18:59:17Z")

</div>

They are not doing a GET or UPDATE, they are really trying to scan the entire file. Sounds like we are going to have to play around with the MULTI-FETCH clause to try and improve performance.

Does anyone have any tips on using MULTI-FETCH?

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [April 27, 2017, 7:13pm UTC](https://techcommunity.softwareag.com/t/how-do-you-scan-an-adabas-file-using-natural/194367/4 "2017-04-27T19:13:41Z")

</div>

If there were no UPDATEs, there would be no L4.

Since you are reading an entire file, there is only one tip if you are on the mainframe:

```auto
MULTI-FETCH 10
```

If you are not on a mainframe, it’s

```auto
MULTI-FETCH ON 
```

“Tips” apply if you are reading a portion of a file. The big tip is

> [@](#):
>
> If you are reading a portion of a file, use Multi-fetch ONLY if you also use both options FROM and TO (not THRU).

ps This would have been better posted on the Natural for Mainframes or Natural for Open Systems forums.

---

<div class="post-metadata">

**Author:** ![Sandy\_Spencer](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/sandy_spencer/32/1219_2.png) [@Sandy\_Spencer](https://techcommunity.softwareag.com/u/Sandy_Spencer)\
**Post date:** [April 27, 2017, 9:45pm UTC](https://techcommunity.softwareag.com/t/how-do-you-scan-an-adabas-file-using-natural/194367/5 "2017-04-27T21:45:05Z")

</div>

I can’t figure out how to post this on the Natural for Mainframes forum. I go to the Natural for Mainframes forum, select submit feedback and I see my own question.

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [April 27, 2017, 11:42pm UTC](https://techcommunity.softwareag.com/t/how-do-you-scan-an-adabas-file-using-natural/194367/6 "2017-04-27T23:42:59Z")

</div>

At the top of the main Forums page, just to the right of center is a Sign In hyperlink. Once you are signed in, select a Forum, such as Natural on Mainframes. Just above the topics list will be a new topic button. Press that to start a new thread.

---

<div class="post-metadata">

**Author:** ![Sandy\_Spencer](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/sandy_spencer/32/1219_2.png) [@Sandy\_Spencer](https://techcommunity.softwareag.com/u/Sandy_Spencer)\
**Post date:** [April 28, 2017, 1:57am UTC](https://techcommunity.softwareag.com/t/how-do-you-scan-an-adabas-file-using-natural/194367/7 "2017-04-28T01:57:56Z")

</div>

Thank you for all your feedback Ralph. I was finally able to repost my questions in the Natural for Mainframes forum

---

<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:38pm UTC](https://techcommunity.softwareag.com/t/how-do-you-scan-an-adabas-file-using-natural/194367/8 "2021-04-02T15:38:22Z")

</div>


