Can NATURAL be called from COBOL?

Hi All,

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

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.

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

Doug’s suggestion sounds easier, IMHO.

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