# Can we reterive the module name in the called module of calling moduling

**URL:** <https://techcommunity.softwareag.com/t/can-we-reterive-the-module-name-in-the-called-module-of-calling-moduling/189170>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [June 22, 2016, 3:55pm UTC](https://techcommunity.softwareag.com/t/can-we-reterive-the-module-name-in-the-called-module-of-calling-moduling/189170 "2016-06-22T15:55:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sarabjeet\_Pal](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@Sarabjeet\_Pal](https://techcommunity.softwareag.com/u/Sarabjeet_Pal)\
**Post date:** [June 22, 2016, 3:55pm UTC](https://techcommunity.softwareag.com/t/can-we-reterive-the-module-name-in-the-called-module-of-calling-moduling/189170/1 "2016-06-22T15:55:13Z")

</div>

Hi

If Subprogram A calls Subprogram B,Can I by somehow get the name of module A inside B without passing module name via parameter.

Thanks

Regards  
Sarabjeet Pal

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson3](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@Steve\_Robinson3](https://techcommunity.softwareag.com/u/Steve_Robinson3)\
**Post date:** [June 22, 2016, 4:17pm UTC](https://techcommunity.softwareag.com/t/can-we-reterive-the-module-name-in-the-called-module-of-calling-moduling/189170/2 "2016-06-22T16:17:37Z")

</div>

Not from subprogram to subprogram. Only way is by passing a parameter.

If you are PERFORMing an external subroutine, you have access to the current global data area so you do not have to pass the name all the time, just have a field in the gda with the name.  
This cannot be done, however with a CALLNAT. The “callnatee” does not have access to the gda current with the “callnater”.

---

<div class="post-metadata">

**Author:** ![Finn\_the\_Dane1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/finn_the_dane1/32/132_2.png) [@Finn\_the\_Dane1](https://techcommunity.softwareag.com/u/Finn_the_Dane1)\
**Post date:** [June 22, 2016, 4:34pm UTC](https://techcommunity.softwareag.com/t/can-we-reterive-the-module-name-in-the-called-module-of-calling-moduling/189170/3 "2016-06-22T16:34:23Z")

</div>

Perhaps the TECH info can provide that ?

Names, types and levels of the currently active Natural object and all objects on higher levels, as well as the line numbers of the statements invoking the subordinate objects (Mainframes, UNIX and OpenVMS only).

Try to have a look at USR2026N  
Finn

---

<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:** [June 22, 2016, 4:39pm UTC](https://techcommunity.softwareag.com/t/can-we-reterive-the-module-name-in-the-called-module-of-calling-moduling/189170/4 "2016-06-22T16:39:07Z")

</div>

We use USR0600N to retrieve the chain of modules.

```auto
DEFINE DATA LOCAL
1 #CHAIN (A8/20)                         
1 #LEVEL (P3/20)                         
END-DEFINE                               
*                                        
CALLNAT 'USR0600N' #CHAIN (*) #LEVEL (*) 
```

---

<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/can-we-reterive-the-module-name-in-the-called-module-of-calling-moduling/189170/5 "2021-04-02T15:36:19Z")

</div>


