Interlanguage Communication (ILC) Between PL/I and COBOL and Assembler AMODE (24/31) Programs

Interlanguage Communication (ILC) means that PL/I programs can call and be called by COBOL and Assembler programs. Micro Focus PL/I now supports AMODE [24|31] in ILC (with some limitations - see the Restrictions section). Assembler is only supported on Windows, and only when the program is run under Enterprise Server.

By default Micro Focus PL/I runs in NOAMODE (Addressing Mode) with POINTER addresses being full 32 bits unless the AMODE option is used. AMODE [24|31] makes the emulated pointer addresses 24 or 31 bits. Usually on mainframe PL/I doesn't run AMODE(24), however in order to co-exist with 24-bit COBOL and z/OS Assembler (i.e. call and be called by programs in these languages), PL/I must run in AMODE(24). All programs in such an environment must be RMODE(24) (Residence Mode). Programs can be mixed RMODE if the Assembler programs or glue Assembler programs make the mode switch upon call and return.

Example 1: ILC with Assembler

In this example, PL/I calls an Assembler program with a variable number of arguments.

dcl printva entry options(asm);
dcl 1 msgs auto,
    3 life    char(7)  var init("Life's "),
    3 good    char(5)  var init("Good!"),
    3 perhaps char(15) var init("... Perhaps ..."),
    3 like    char(7)  var init("Like a "),
    3 box     char(7)  var init("Box of "),
    3 choc    char(11) var init("Chocolates!");
call printva(life, good);
call printva(perhaps);
call printva(life, like, box, choc);
Note: This program must be compiled with the option -amode [31 | 24] and run under Enterprise Server. printva is a subroutine written in Assembler.

Example 2: ILC with COBOL

In this example, PL/I calls a COBOL program with a variable number of arguments.

dcl printvc entry options(COBOL);
dcl 1 msgs auto,
    3 life    char(7)  var init("Life's "),
    3 good    char(5)  var init("Good!"),
    3 perhaps char(15) var init("... Perhaps ..."),
    3 like    char(7)  var init("Like a "),
    3 box     char(7)  var init("Box of "),
    3 choc    char(11) var init("Chocolates!");
call printvc(life, good);
call printvc(perhaps);
call printvc(life, like, box, choc);
Note: printvc is a subroutine written in COBOL.

Restrictions

  • PL/I ILC support for Assembler is currently limited to 32-bit Windows platforms only.
  • PL/I ILC for COBOL is limited to 32-bit platforms only.
  • PL/I ILC does not support POINTER arguments/parameters to be passed/received. This includes POINTER data in structures and unions.
  • Use of variable extents in arrays is not yet supported with the AMODE option.