# Need to set return code from NATURAL program

**URL:** <https://techcommunity.softwareag.com/t/need-to-set-return-code-from-natural-program/79741>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-Code-Samples\
**Created:** [December 9, 2008, 4:55pm UTC](https://techcommunity.softwareag.com/t/need-to-set-return-code-from-natural-program/79741 "2008-12-09T16:55:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arun2](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Arun2](https://techcommunity.softwareag.com/u/Arun2)\
**Post date:** [December 9, 2008, 4:55pm UTC](https://techcommunity.softwareag.com/t/need-to-set-return-code-from-natural-program/79741/1 "2008-12-09T16:55:18Z")

</div>

Hello,

I need to set the return code to JCL from natural program. Depend on the return code need to execute the subsequent steps.

I have tried TERMINATE statement job abended(message:user abend).

Is ther any way to set the return code to JCL from natural program.  
Please help!

Thanks,  
Arun

---

<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:** [December 9, 2008, 5:42pm UTC](https://techcommunity.softwareag.com/t/need-to-set-return-code-from-natural-program/79741/2 "2008-12-09T17:42:14Z")

</div>

Hi,

TERMINATE will set the condition code that can be checked by following steps and should normally not cause an abend.

What value did you try with?

---

<div class="post-metadata">

**Author:** ![Arun2](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Arun2](https://techcommunity.softwareag.com/u/Arun2)\
**Post date:** [December 9, 2008, 5:46pm UTC](https://techcommunity.softwareag.com/t/need-to-set-return-code-from-natural-program/79741/3 "2008-12-09T17:46:11Z")

</div>

Hi ,

I have tried with TERMINATE 02 and 03.program returns the following abend.  
NAT9987 Natural session terminated abnormally - RC=002.

Natural is terminating normally when giving TERMINATE 00.For all other values program is abending.

Thanks,  
Arun 🙂

---

<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:** [December 9, 2008, 5:57pm UTC](https://techcommunity.softwareag.com/t/need-to-set-return-code-from-natural-program/79741/4 "2008-12-09T17:57:30Z")

</div>

This is also correct and this is not abend (=S…)

If you look at the joblog you can see the step ended with a condition code of 2 (or 3) and not with an Operating System Abend Code (like SB37).

---

<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:51pm UTC](https://techcommunity.softwareag.com/t/need-to-set-return-code-from-natural-program/79741/5 "2021-04-02T14:51:16Z")

</div>


