Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Linking ILCS programs and non-ILCS programs of the same language

&pagelevel(4)&pagelevel

There are different rules for linking ILCS programs and same-language non-ILCS programs (i.e. programs not generated by an ILCS-compatible compiler); these rules depend on the language (compiler and associated runtime system). In the following, the rules to be observed when linking ILCS and non-ILCS programs are described only for the CRTE languages COBOL and C and also for Assembler.
The rules for other languages (e.g. Fortran, Pascal) are described in the relevant user guides.

COBOL85

The linking of non-ILCS programs (i.e. programs created with COBOL85 V1.0) to ILCS programs is basically possible. Program communication via ILCS can only be ensured, however, if the main program is an ILCS program. If the main program is a non-ILCS program, all called ILCS subprograms are seen as non-ILCS programs.

COBOL2000

The linking of non-ILCS programs (i.e. programs created with COBOL85 V1.0) to ILCS programs is basically possible.
Since COBOL2000 always uses the ILCS infrastructure internally, ILCS is initialized when COBOL2000 modules are called, even if the main program is a non-ILCS program.

Using COBOL programs with USE procedures requires a valid backwards concatenation in the save area. X’FFFFFFFF’ or X’00000000’ are interpreted as the end of the backwards concatenation.

C and C++

Non-ILCS programs (i.e. programs created with C V1.0) and ILCS programs in C can be linked to one another without difficulty. If the calling program is a C V1.0 program, the ILCS environment is initialized automatically by the C runtime system. Linking is possible up to C Version 2.0 without precautionary measures, but from C or C++ Version 2.1A onward it is possible only under the following conditions:
At compilation, the default setting INLINE-OPTIMAL of the LINKAGE parameter must be changed to OUT-OF-LINE or V1-COMPATIBLE-INLINE in the COMPILER-ACTION option.Compilation of a C program with the C++ compiler must be performed in KR or ANSI mode. Programs compiled in CPLUSPLUS mode cannot be linked to C V1.0 objects.

Assembler

For a non-ILCS program to be able to call an ILCS program, it is necessary to adapt the save area of the non-ILCS program to comply with the ILCS convention. This adaptation can be carried out by the user as follows:

  • The save area of the non-ILCS object must be created with the IT0VSA macro.

  • Before the ILCS object is called, the field &P.VPCD must be supplied with the address of the current IT0PCD module. This address can be ascertained from address constant A(IT0PCD).

For an example, see the appendix.

Java

There are various methods for linking C/C++ programs and Java programs, for example linkage via the Java Native Interface (JNI). For more information on this subject, refer to your Java documentation.