# read source code of natural (from the adabas)

**URL:** <https://techcommunity.softwareag.com/t/read-source-code-of-natural-from-the-adabas/189091>\
**Category:** Forum\
**Tags:** Adabas-Natural, Adabas, Adabas-on-Mainframes, Adabas-Basics-on-Mainframes\
**Created:** [June 19, 2016, 2:15pm UTC](https://techcommunity.softwareag.com/t/read-source-code-of-natural-from-the-adabas/189091 "2016-06-19T14:15:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yoav\_Gu](https://avatars.discourse-cdn.com/v4/letter/y/ac91a4/32.png) [@Yoav\_Gu](https://techcommunity.softwareag.com/u/Yoav_Gu)\
**Post date:** [June 19, 2016, 2:15pm UTC](https://techcommunity.softwareag.com/t/read-source-code-of-natural-from-the-adabas/189091/1 "2016-06-19T14:15:44Z")

</div>

Hi,

I want to read the source code of NATURAL program/s and sub-program/s from natural program,  
how can i do that ? the source code save in adabas file which file ? or  
there is API program/s ?

Thanks

---

<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:** [June 19, 2016, 10:47pm UTC](https://techcommunity.softwareag.com/t/read-source-code-of-natural-from-the-adabas/189091/2 "2016-06-19T22:47:52Z")

</div>

Although it is possible to read a Natural system file via Adabas direct commands from any supported programming language, it is much simpler to access FUser with a Natural program using Natural’s API. Several subprograms deal with the subject, but you should start with

- USR1055N Read a source into an array

- USR2019N Read a source into the Source Work Area

For more information on Natural’s API, look at its SYSEXT utility.

---

<div class="post-metadata">

**Author:** ![Yoav\_Gu](https://avatars.discourse-cdn.com/v4/letter/y/ac91a4/32.png) [@Yoav\_Gu](https://techcommunity.softwareag.com/u/Yoav_Gu)\
**Post date:** [June 20, 2016, 5:15pm UTC](https://techcommunity.softwareag.com/t/read-source-code-of-natural-from-the-adabas/189091/3 "2016-06-20T17:15:45Z")

</div>

Do you have sample code to read in Adabas direct commands ?

when i run USR2019P (call to USR2019N) there is an error:

==err\> 1000 6972 Directory error on Client, reason 4 ,

Thanks Yoav.

---

<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:** [June 21, 2016, 8:24am UTC](https://techcommunity.softwareag.com/t/read-source-code-of-natural-from-the-adabas/189091/4 "2016-06-21T08:24:18Z")

</div>

As explained in the message’s help text, the 6972 likely is masking error 0082. Logon to library SYSEXT, put SYSEXT in your Steplib chain, or copy USR2019N to your current Natural library. That should resolve the error.

I see no need for the complexity of Adabas direct calls when Natural is so easy.

---

<div class="post-metadata">

**Author:** ![Yoav\_Gu](https://avatars.discourse-cdn.com/v4/letter/y/ac91a4/32.png) [@Yoav\_Gu](https://techcommunity.softwareag.com/u/Yoav_Gu)\
**Post date:** [June 21, 2016, 9:37am UTC](https://techcommunity.softwareag.com/t/read-source-code-of-natural-from-the-adabas/189091/5 "2016-06-21T09:37:48Z")

</div>

I tried USR1057N and it work great.

Thanks

---

<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:36pm UTC](https://techcommunity.softwareag.com/t/read-source-code-of-natural-from-the-adabas/189091/6 "2021-04-02T15:36:17Z")

</div>


