# Can NATURAL be called from COBOL?

**URL:** <https://techcommunity.softwareag.com/t/can-natural-be-called-from-cobol/92614>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [January 27, 2010, 8:26pm UTC](https://techcommunity.softwareag.com/t/can-natural-be-called-from-cobol/92614 "2010-01-27T20:26:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ats](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@Ats](https://techcommunity.softwareag.com/u/Ats)\
**Post date:** [January 27, 2010, 8:26pm UTC](https://techcommunity.softwareag.com/t/can-natural-be-called-from-cobol/92614/1 "2010-01-27T20:26:27Z")

</div>

Hi All,

I would like to know if a NATURAL program be called from COBOL? Please share your thoughts if it’s possible.

---

<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:** [January 27, 2010, 9:21pm UTC](https://techcommunity.softwareag.com/t/can-natural-be-called-from-cobol/92614/2 "2010-01-27T21:21:42Z")

</div>

Ats,

Yes, you can.

Just define something like this:

01 NAT-PARMS PIC X(200) VALUE SPACES.  
01 WS-COMMAREA.  
05 RESTART-TRAN-ID PIC X(04).  
05 DYN-PARMS-ADDRESS USAGE IS POINTER.  
05 DYN-PARMS-LENGTH PIC S9(04) COMP.  
05 NAT-TRAN-ID PIC X(04).  
05 RET-PGM-ID PIC X(08).

and execute something like this:

MOVE EIBTRNID TO RESTART-TRAN-ID.  
MOVE ‘MQNT’ TO NAT-TRAN-ID.  
MOVE 228 TO DYN-PARMS-LENGTH.  
MOVE HIGH-VALUES TO RET-PGM-ID.  
MOVE NAT-PARMS TO PARM-DATA.

EXEC CICS LINK  
PROGRAM (‘NATNUC’)  
COMMAREA(WS-COMMAREA)  
LENGTH (22)  
END-EXEC.

and have NAT-PARMS (PARM-DATA) be your logon string (profile, user id, password, etc). Specifics here will be different there, but hopefully this gives you enough to move in the right direction.

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [January 28, 2010, 12:52am UTC](https://techcommunity.softwareag.com/t/can-natural-be-called-from-cobol/92614/3 "2010-01-28T00:52:44Z")

</div>

There is a documented method to call subprograms (= CALLNAT) from 3GL’s also.

[http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat426mf/ops\_mf/calln-over.htm#calln-over](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat426mf/ops_mf/calln-over.htm#calln-over)

---

<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:** [January 28, 2010, 2:45am UTC](https://techcommunity.softwareag.com/t/can-natural-be-called-from-cobol/92614/4 "2010-01-28T02:45:48Z")

</div>

Doug’s suggestion sounds easier, IMHO.

---

<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:** [February 1, 2010, 4:00pm UTC](https://techcommunity.softwareag.com/t/can-natural-be-called-from-cobol/92614/5 "2010-02-01T16:00:00Z")

</div>

pls check NCI 4.2 source lib: we are delivering 4 samples of COBOL programs invoking Natural using different techniques:

- XNCIFRCL - COBOL invoking NAT via EXEC CICS LINK
- XNCIFRCR - COBOL invoking NAT via EXEC CICS RETURN IMMEDIATE
- XNCIFRCS - COBOL invoning NAT via EXEC CICS START
- XNCIFRCX - COBOL invoking NAT via EXEC CICS XCTL

---

<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:57pm UTC](https://techcommunity.softwareag.com/t/can-natural-be-called-from-cobol/92614/6 "2021-04-02T14:57:58Z")

</div>


