Language Environment considerations for PL/I applications

The advice and restrictions listed in Programming in PL/I apply to PL/I programs running under Language Environment®.

Language Environment-conforming PL/I programs can CALL a program that appears in a FETCH or RELEASE statement and can RELEASE it subsequently.

There are some restrictions on the PL/I for MVS™ & VM statements that can be used in a fetched procedure. These restrictions are described in PL/I MVS & VM Language Reference.. Many of the restrictions have been removed with VisualAge® PL/I. See the VisualAge PL/I for OS/390 Compiler and Run-Time Migration Guide.

To enable a PL/I procedure to be fetched, code the option FETCHABLE in the OPTIONS on the PROCEDURE statement. This option indicates that the procedure can only be invoked dynamically. An OPTIONS(MAIN) procedure cannot be fetched; FETCHABLE and MAIN are mutually exclusive options. Treat the FETCHABLE procedure like a normal CICS® program: that is, link-edited with any required subroutines, placed in the CICS application program library, defined, and installed as a program, either in the CSD or using program autoinstall.

No special considerations apply to the use of FETCH when both the fetching and the fetched programs have the same AMODE attribute. Language Environment , however, also supports the fetching of a load module that has an AMODE attribute different to the program issuing the FETCH. In this case, Language Environment performs the AMODE switch, and the following constraints apply:

Communicating between modules compiled with different compilers
You can link-edit non-Language Environment-conforming PL/I subroutines with a Language Environment-conforming main program. Static calls are supported from any version of PL/I, but dynamic calls are supported only from Language Environment-conforming procedures. Called subroutines can issue CICS commands if the address of the EIB is available in the subroutine. You can achieve this either by passing the address of the EIB to the subroutine, or by coding EXEC CICS ADDRESS EIB(DFHEIPTR) in the subroutine before issuing any other CICS commands.
Entry point
CEESTART is the only entry point for PL/I applications running under Language Environment. This entry point is set for programs compiled using Language Environment-conforming compilers. You can re-link object modules produced by non-Language Environment-conforming compilers for running under Language Environment by using the following linkage-editor statements:
     INCLUDE SYSLIB(CEESTART)
     INCLUDE SYSLIB(CEESG010) 
     INCLUDE SYSLIB(DFHELII) 
     REPLACE PLISTART 
     CHANGE PLIMAIN(CEEMAIN) 
     INCLUDE  mainprog 
     INCLUDE   subprog1 
     ....... 
     ....... 
     ORDER CEESTART 
     ENTRY CEESTART 
     NAME  progname(R) 
The INCLUDE statement for the object modules must come immediately after the CHANGE statement and there is also a requirement under Language Environment that the main program must be included before any subroutines. (This requirement did not exist for modules produced by non-conforming compilers.) For Enterprise PL/I programs that are compiled with OPTIONS(FETCHABLE), the binder ENTRY statement must be the name of the PROCEDURE.
Re-link utility for PL/I
If you have only the load module for a CICS program compiled by a non-conforming compiler, there is a file of linkage editor input, IBMWRLKC, specifically for CICS programs, located in the sample library SCEESAMP, to replace OS PL/I library routines in a non-conforming executable program with Language Environment routines. For more information about using IBMWRLKC, see the PL/I MVS & VM V1R1.1 Compiler & Runtime Migration Guide.
Abend codes
If a CICS PL/I program abends under Language Environment , your CICS abend handlers are given a Language Environment abend code, rather than a PL/I abend code. To avoid changing your programs, you can modify the sample user condition handler, CEEWUCHA, supplied by Language Environment in the SCEESAMP library. This user condition handler can be made to return PL/I abend codes instead of the Language Environment codes. Use the USRHDLR runtime option to register it to do this. For details of this option see the z/OS Language Environment Programming Guide.
[[ Contents Previous Page | Next Page Index ]]