# NATURAL Is there a way to know what program called a sub-program without passing \*PROGRAM when the subprogram is called?

**URL:** <https://techcommunity.softwareag.com/t/natural-is-there-a-way-to-know-what-program-called-a-sub-program-without-passing-program-when-the-subprogram-is-called/294767>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [April 17, 2024, 12:21pm UTC](https://techcommunity.softwareag.com/t/natural-is-there-a-way-to-know-what-program-called-a-sub-program-without-passing-program-when-the-subprogram-is-called/294767 "2024-04-17T12:21:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Wilson2](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@Chris\_Wilson2](https://techcommunity.softwareag.com/u/Chris_Wilson2)\
**Post date:** [April 17, 2024, 12:21pm UTC](https://techcommunity.softwareag.com/t/natural-is-there-a-way-to-know-what-program-called-a-sub-program-without-passing-program-when-the-subprogram-is-called/294767/1 "2024-04-17T12:21:48Z")

</div>

NATURAL Is there a way to know what program called a sub-program without passing \*PROGRAM when the subprogram is called?

---

<div class="post-metadata">

**Author:** ![Jerome\_LeBlanc](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/jerome_leblanc/32/111_2.png) [@Jerome\_LeBlanc](https://techcommunity.softwareag.com/u/Jerome_LeBlanc)\
**Post date:** [April 17, 2024, 2:57pm UTC](https://techcommunity.softwareag.com/t/natural-is-there-a-way-to-know-what-program-called-a-sub-program-without-passing-program-when-the-subprogram-is-called/294767/2 "2024-04-17T14:57:42Z")

</div>

Yes, at least on our version on the mainframe, there is a module we call to get the chain of modules up to the current module, USR0600N.

```auto
...
1 #CHAIN (A8/20)
1 #LEVEL (P3/20)
...
CALLNAT 'USR0600N' #CHAIN (*) #LEVEL (*)
...

```

I hope it works for you.

---

<div class="post-metadata">

**Author:** ![spleen](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@spleen](https://techcommunity.softwareag.com/u/spleen)\
**Post date:** [April 19, 2024, 10:55am UTC](https://techcommunity.softwareag.com/t/natural-is-there-a-way-to-know-what-program-called-a-sub-program-without-passing-program-when-the-subprogram-is-called/294767/3 "2024-04-19T10:55:33Z")

</div>

Maybe the RETURN\* command is something you can use.  
RETURN

`RETURN`

![](https://global.discourse-cdn.com/techcommunity/original/3X/1/7/17401e18604e1d1927c168938775fb5d850b5acd.gif)

![](https://global.discourse-cdn.com/techcommunity/original/3X/1/4/140f539924e742aa4007f4d817ae43bfcf6a664b.gif)

[`I`](https://documentation.softwareag.com/natural/nat827mf/syscom/return.htm#return_i)

![](https://global.discourse-cdn.com/techcommunity/original/3X/0/e/0eabf44679406ab317bc55cde8777a43a4e8da2f.gif)

![](https://global.discourse-cdn.com/techcommunity/original/3X/f/e/fe27188526b4fda7e2a9be549e05c1c53d77a036.gif)

[``](https://documentation.softwareag.com/natural/nat827mf/syscom/return.htm#return_nn)  
[`*`](https://documentation.softwareag.com/natural/nat827mf/syscom/return.htm#return_ast)

This command is used to return to a previous (or initial) Natural application.

Application programming interface: `USR1026N`. See [SYSEXT - Natural Application Programming Interfaces](https://documentation.softwareag.com/natural/nat827mf/utis/sysext.htm) in the documentation.

> `RETURN` |   
>   
> If `RETURN` is specified without any parameters, control will be returned to the previous application (as defined with the system command [`SETUP`](https://documentation.softwareag.com/natural/nat827mf/syscom/setup.htm#setup)). All information about this previous application will be deleted. If no previous application exists, control is returned to the initial application.  
>   
>   
>   
> If `RETURN` is issued and no return point is set, the `RETURN` command will be ignored.  
>   
> Under Natural Security:  
>   
>   
> A `LOGOFF` command will be executed if `RETURN` is issued and no return point has been set.  
>   
> |
> 
> - | - |  
> `RETURN I` | This command causes control to be returned directly to the initial application. This option also causes Natural to delete all definitions of previous applications (except that of the initial application). |  
> `RETURN` | This command causes control to be returned to the th previous application. When this option is used, all information for applications subsequent to the th application is deleted. |  
> `RETURN *` | This command will display a list of all return points which are currently set up. On the list you may then select the return point to which you wish to return. |

See the [`SETUP`](https://documentation.softwareag.com/natural/nat827mf/syscom/setup.htm#setup) command for further information and examples.

---

<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:** [October 16, 2024, 10:55am UTC](https://techcommunity.softwareag.com/t/natural-is-there-a-way-to-know-what-program-called-a-sub-program-without-passing-program-when-the-subprogram-is-called/294767/4 "2024-10-16T10:55:51Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
