Run unit

A run unit consists of a main program and the other programs to which it transfers control. Those other programs can be called programs, or, in some cases, other main programs. Each run unit has these characteristics:

For implementation specifics, see "Compatibility" in this topic.

Compatibility

Table 1. Compatibility considerations for the run unit
Platform Issue
Java™ generation

When you generate EGL for Java, the run unit is composed of programs that run in a single thread.

A new run unit can start with a main program, as when the user invokes the program. A transfer statement or a show statement with a returning clause also calls a main program but continues the same run unit.

In the following cases, a called program is the initial program of a run unit:
  • The call is a remote call, except that the same run unit continues in the following case:
    • The called program is generated by EGL or VisualAge® Generator; and
    • No TCP/IP listener is involved in the call.

All programs in a Java run unit are affected by the same Java runtime properties.

CICS®
The CICS run unit is composed of EGL and non-EGL programs that run as a single CICS transaction invocation. This includes the following:
  • EGL programs that call another program.
  • EGL programs that transfer to another program using a transfer to program statement.
  • Non-EGL programs that call another program using a CALL statement or a CICS LINK command.
  • Non-EGL programs that transfer to another program using a CICS XCTL command.
A CICS run unit ends when any of the following actions occurs in the run unit:
  • An EGL program uses a segmented converse.
  • An EGL program transfers using a show statement or a transfer to transaction statement.
  • An EGL main program ends without transferring.
  • A non-EGL pseudo-conversational program responds to the user.
  • A non-EGL program transfers to another program using a CICS START command.
  • A non-EGL program ends without transferring.
All programs in a CICS run unit are affected by properties that are specified when the CICS region is configured, and all those programs have access to the same transaction work area (TWA).

IMS BMP
z/OS batch

The run unit is composed of the programs that run in a single job step, regardless of whether transfers of control occur by way of call statements or transfer statements. All programs in the run unit have access to the same DD statements. For non-EGL programs in the run unit, this includes the use of the CALL statement or an OS XCTL macro.

IMS/VS
The IMS/VS run unit is composed of EGL and non-EGL programs that run as a single IMS™ transaction invocation. This includes of the following:
  • EGL programs that call another program.
  • EGL programs that transfer to another program using a transfer to program statement.
  • Non-EGL programs that call another program.
An IMS/VS run unit ends when any of the following occur in the run unit:
  • An EGL program uses a converse.
  • An EGL program transfers using a show statement or a transfer to transaction statement.
  • An EGL main program ends without transferring.
  • A non-EGL program responds to the user.
  • A non-EGL program performs a program-to-program immediate or deferred switch.
All programs in an IMS/VS run unit are affected by properties that are specified when the IMS system is configured.
iSeries® COBOL
The iSeries COBOL run unit is composed of the main program and the programs called (directly or indirectly) from that program. The run unit ends when a main program ends, as in these cases:
  • The program returns to the non-EGL program from which it was started; or
  • The program issues a show statement with a returning clause or a transfer to transaction statement.

Feedback