Basic link-editing and running PL/I routines under z/OS UNIX with POSIX(ON)

Note: The following section does not apply to Enterprise PL/I for z/OS; they only apply to the earlier PL/I products.

When the runtime option POSIX(ON) is specified, PL/I routines in the IPT follow the same rules and behave the same as when POSIX(ON) is not in effect.

PL/I routines in non-IPTs, however, must observe the following rules, or the result is unpredictable. No runtime diagnosis is provided to enforce these rules.
  • The non-IPT must be created by a C/C++ routine or assembler program. PL/I routines must be reentrant and in AMODE(31). A PL/I routine can be the first routine in the thread. To ensure the PL/I-specific runtime is available at the time the PL/I routine is running in a non-IPT, one of the following must be true in the main executable program:
    • A PL/I routine directly calls a C/C++ routine
    • A C/C++ routine directly calls a PL/I routine
    • A PL/I for MVS & VM routine is present in the executable program
    • Language Environment PL/I signature CSECT CEESG010 is explicitly included in the executable program
    If none of the above exists in the main executable program and a PL/I routine is going to run in a particular thread, you must do one of the following in that thread:
    • Fetch or dynamically call an executable program that contains a PL/I routine
    • Fetch or dynamically call an executable program that contains Language Environment PL/I signature CSECT CEESG010
  • PL/I routines in non-IPTs are supported in the same environments as the C/C++ routines, except the z/OS UNIX shells. The executable form of PL/I routines, however, can run under the shells in conjunction with C/C++ routines in the application using the utilities provided by z/OS UNIX.
  • OS PL/I routines can be in non-IPTs. See the appropriate migration guide in the IBM Enterprise PL/I for z/OS library for the OS PL/I executable programs supported under Language Environment.
  • The following functions are not supported:
    • PL/I language constructs associated with MTF, the Language Environment PL/I MTF-specific runtime option PLITASKCOUNT, the Language Environment PL/I MTF-specific trace facility via the runtime option TRACE(ON,,,LE=2), and the PL/I MTF-specific data set SIBMTASK. The language constructs are:
      • CALL statement with TASK, EVENT, or PRIORITY option
      • EVENT variable
      • COMPLETION and STATUS built-in function and pseudovariable
      • WAIT statement
      • PRIORITY built-in function and pseudovariable
      • DELAY statement
    • I/O using PL/I language statements is not supported except for the limited support provided using the SYSPRINT file and DISPLAY statement.
    • PL/I FETCH and RELEASE statements are not supported.
    • Controlled variables are not supported.
    • Data sharing among threads is limited. Variables must not be referred to across thread boundaries even though the scope of the PL/I names declaration is unchanged.
    • ON-unit inheritance is defined at the thread level. No ON-unit inheritance is provided from the creating threads.
  • The following functions are supported with restrictions:
    • SYSPRINT

      If the SYSPRINT file is defined as STREAM OUTPUT EXTERNAL and it is opened in the IPT before any other threads are created, the SYSPRINT file can be shared among the threads. The file must remain open while other threads are using it. The file must be closed explicitly by the IPT or implicitly by Language Environment when the application terminates.

    • DISPLAY

      The DISPLAY statement without the REPLY option and EVENT option is supported.

    • CALL

      The PL/I routine in the non-IPT must not call a subroutine fetched in the initial thread, even if the routine has been fetched before the noninitial thread is created.

    • EXIT

      EXIT is not recommended. When it is used, only the current thread is exited. If the EXIT statement is used in the initial thread, the entire application terminates. There is no defined order as to which thread terminates first.

    • STOP

      STOP is not recommended. When it is used, the entire application terminates. There is no defined order as to which thread terminates first.

    • If a thread is designed to be used many times before it is terminated, reset the user return code by using PLIRETC(0) in the first PL/I routine in the thread.
  • The z/OS UNIX-defined signals are handled in the same way for PL/I routines in non-IPT and IPT environments. If the z/OS UNIX signals are delivered to PL/I routines, the signals are ignored until the PL/I routine returns.