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.
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);
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);