Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Programming Guide


Transferring control to another program

You can use several different methods to transfer control to another program: static calls, dynamic calls, calls to nested programs, and calls to dynamic link libraries (DLLs).

In addition to making calls between Enterprise COBOL programs, you can also make static and dynamic calls between Enterprise COBOL and programs compiled with older compilers in all environments including CICS.

When you use OS/VS COBOL with Enterprise COBOL, there are differences in support between non-CICS and CICS:

In a non-CICS environment
You can make static and dynamic calls between Enterprise COBOL and other COBOL programs.

Exception: You cannot call VS COBOL II or OS/VS COBOL programs in the UNIX environment.

In a CICS environment
You cannot call OS/VS COBOL programs in the CICS environment. You must use EXEC CICS LINK to transfer control between OS/VS COBOL programs and other COBOL programs.

Calls to nested programs allow you to create applications using structured programming techniques. You can use nested programs in place of PERFORM procedures to prevent unintentional modification of data items. Call nested programs using either the CALL literal or CALL identifier statement.

Calls to dynamic link libraries (DLLs) are an alternative to COBOL dynamic CALL, and are well suited to object-oriented COBOL applications, UNIX programs, and applications that interoperate with C/C++.

Under z/OS, linking two load modules together results logically in a single program with a primary entry point and an alternate entry point, each with its own name. Each name by which a subprogram is to be dynamically called must be known to the system. You must specify each such name in linkage-editor or binder control statements as either a NAME or an ALIAS of the load module that contains the subprogram.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)