# How to execute inline NATURAL code from JCL?

**URL:** <https://techcommunity.softwareag.com/t/how-to-execute-inline-natural-code-from-jcl/96456>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes, Natural-Database-and-TP-Monitor-Interfaces-on-Mainframes\
**Created:** [March 11, 2011, 4:54pm UTC](https://techcommunity.softwareag.com/t/how-to-execute-inline-natural-code-from-jcl/96456 "2011-03-11T16:54:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aman3](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@Aman3](https://techcommunity.softwareag.com/u/Aman3)\
**Post date:** [March 11, 2011, 4:54pm UTC](https://techcommunity.softwareag.com/t/how-to-execute-inline-natural-code-from-jcl/96456/1 "2011-03-11T16:54:46Z")

</div>

Hi folks, I have a very unusual requirement.

I have 3 sets of NAT code with me. These NAT code performs Adabas read, Adabas Update & Adabas Store. But these are not stored as NATURAL objects.

I want to execute these set of NATURAL statements from my JCL without calling any Natural program. How can i execute an inline NAT code from JCL or the NAT code in PDS?

Please help urgently!

---

<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:** [March 11, 2011, 6:07pm UTC](https://techcommunity.softwareag.com/t/how-to-execute-inline-natural-code-from-jcl/96456/2 "2011-03-11T18:07:04Z")

</div>

Education, education, education !!!

If I understand your question correctly, you cannot do what you have proposed to do.

Natural is a compiler. You need to invoke the compiler in order to execute Natural statements (e.g a READ or UPDATE).

This is done via a Natural program.

I have no idea what you mean by “I have 3 sets of NAT code with me.” It sounds like you have a text file with some Natural statements. Such a text file is totally useless unless pasted into a Natural program.

steve

---

<div class="post-metadata">

**Author:** ![Brian\_Johnson1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/brian_johnson1/32/163_2.png) [@Brian\_Johnson1](https://techcommunity.softwareag.com/u/Brian_Johnson1)\
**Post date:** [March 11, 2011, 7:22pm UTC](https://techcommunity.softwareag.com/t/how-to-execute-inline-natural-code-from-jcl/96456/3 "2011-03-11T19:22:09Z")

</div>

If the code is in a dataset, it could be used if slightly modified… after the logon in batch mode, the EDT editor could be invoked, then all the code through END, then .E, then RUN.

Our purpose for that is when we need to dynamically build Natural code with another Natural program. I am not sure why this is important in Aman’s case, as he didn’t explain why his Natural code is not stored as Natural objects.

Special note to Natural Security admins: this is a powerful capability. Please be sure you only allow source to be RUN in production by trusted id’s in trusted locations. SOX violations may abound if not controlled.

---

<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:** [March 12, 2011, 12:32am UTC](https://techcommunity.softwareag.com/t/how-to-execute-inline-natural-code-from-jcl/96456/4 "2011-03-12T00:32:28Z")

</div>

Examples of Brian’s suggestion can be found in a previous post:  
[http://tech.forums.softwareag.com/viewtopic.php?p=23478&sid=4b83ee51ec2f5e97541892824168f56c#23478](http://tech.forums.softwareag.com/viewtopic.php?p=23478&sid=4b83ee51ec2f5e97541892824168f56c#23478)

---

<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, 2:59pm UTC](https://techcommunity.softwareag.com/t/how-to-execute-inline-natural-code-from-jcl/96456/5 "2021-04-02T14:59:55Z")

</div>


