Sign in

docs ILE Concepts

ILE Program

ILE Program

ILE Program

An ILE program shares the following characteristics with an OPM program:

  • The program gets control through a dynamic program call.
  • There is only one entry point to the program.
  • The program is identified to the system by the symbol *PGM.

An ILE program has the following characteristics that an OPM program does not have:

  • An ILE program is created from one or more copied module objects.

  • One or more of the copied modules can contain a PEP.

  • You have control over which module’s PEP is used as the PEP for the ILE program object.

    When the Create Program (CRTPGM) command is specified, the ENTMOD parameter allows you to select which module containing a PEP is the program’s entry point.

    A PEP that is associated with a module that is not selected as the entry point for the program is ignored. All other procedures and data items of the module are used as specified. Only the PEP is ignored.

When a dynamic program call is made to an ILE program, the module’s PEP that was selected at program-creation time is given control. The PEP calls the associated UEP.

When an ILE program object is created, only those procedures associated with the copied modules containing debug data can be debugged by the ILE debugger. The debug data does not affect the performance of a running ILE program.

Figure 1 shows a conceptual view of an ILE program object. When the program PGMEXAMP is called, the PEP of the program, which was defined in the copied module object M3, is given control. The copied module M2 also has a PEP defined, but it is ignored and never used by the program.

In this program example, only two modules, M1 and M3, have the necessary data for the ILE debugger. Procedures from modules M2 and M4 cannot be debugged with the ILE debugger.

The imported procedures print and SIN are resolved to exported procedures from service programs PRINTS and MATHFUNC, respectively.

Figure 1. Conceptual View of an ILE Program

Characteristics of an ILE *PGM object:

  • One or more modules from any ILE language are copied to make the *PGM object.
  • The person who creates the program has control over which module’s PEP becomes the only PEP for the program.
  • On a dynamic program call, the module’s PEP that was selected as the PEP for the program gets control to run.
  • The UEP associated with the selected PEP is the user’s entry point for the program.
  • Procedures and data item names cannot be exported from the program.
  • Procedures or data item names can be imported from modules and service programs but not from program objects. For information on service programs, see Service Program.
  • Modules can have debug data.
  • A program is a runnable object.