Mixing languages in Language Environment

This section tells you how to build an application that is composed of programs that have been written in different high-level source languages.

Assembler subroutines called from an HLL program are fairly straightforward and not uncommon. A subroutine called from one HLL but written in another needs much more careful consideration and involves what is called interlanguage communication (ILC). Language Environment® defines an ILC application as one built of two or more HLLs and, optionally, assembler. See z/OS Language Environment Writing Interlanguage Communication Applications for full details on this subject.

Language Environment dictates that if there is any ILC within a run unit under CICS®, each compile unit must be compiled with a Language Environment-conforming compiler. CICS supports three HLLs: C/C++, COBOL, and PL/I. We consider the interfaces in pairs. If your application contains only two HLLs, consult the appropriate section. If your application contains all three HLLs, consult those sections corresponding to each of the interfaces within your application.

C/C++ and COBOL
The conditions under which Language Environment supports ILC between routines written in C/C++ and COBOL depend on the following:

The results of all this are specified in five tables in z/OS Language Environment Writing Interlanguage Communication Applications; you should consult this book if your application mixes C/C++ and COBOL.

C/C++ and PL/I
Under CICS, if all the components of your C/C++ and PL/I application are reentrant, Language Environment supports ILC between routines compiled by OS/390® C/C++ and PL/I for MVS™ & VM or VisualAge® PL/I for OS/390 as follows:
COBOL and PL/I
Under CICS, Language Environment supports ILC between routines compiled with Language Environment-supported COBOL and PL/I compilers, as follows: If the called routine contains any CICS commands then the calling routine must pass the EIB and the COMMAREA as the first two parameters on the CALL statement.
Assembler
The following rules apply: Additionally, you can make static calls from any Language Environment-conforming HLL program or assembler subroutine to a non-conforming assembler subroutine. However, a non-conforming assembler routine cannot make a static call to any Language Environment-conforming routine, nor can it fetch or load a conforming routine, since it cannot use the Language Environment macros.
Note:
For assembler to call C or C++, you must include the following statement:
C
#pragma linkage(,OS)
C++
extern "OS"
DL/I
If you are using DL/I in your ILC application under CICS, calls to DL/I, either by an EXEC DLI statement or by a CALL xxxTDLI, can be made only in programs with the same language as the main program.

Language Environment does not support CALL CEETDLI under CICS.

[[ Contents Previous Page | Next Page Index ]]