Program Entry Procedure Module Parameter on the CRTPGM Command

The program entry procedure module (ENTMOD) parameter tells the binder the name of the module in which the following are located:
  • Program entry procedure (PEP)
  • User entry procedure (UEP)
This information identifies which module contains the PEP that gets control when making a dynamic call to the program that is created.

The default value for the ENTMOD parameter is *FIRST. This value specifies that the binder uses as the entry module the first module it finds in the list of modules specified on the module parameter that contains a PEP.

If the following conditions exist:
  • *FIRST is specified on the ENTMOD parameter
  • A second module with a PEP is encountered
the binder copies this second module into the program object and continues the binding process. The binder ignores the additional PEP.

If *ONLY is specified on the ENTMOD parameter, only one module in the program can contain a PEP. If *ONLY is specified and a second module with a PEP is encountered, the program is not created.

For explicit control, you can specify the name of the module that contains the PEP. Any other PEPs are ignored. If the module explicitly specified does not contain a PEP, the CRTPGM request fails.

To see whether a module has a program entry procedure, you use the display module (DSPMOD) command. The information appears in the Program entry procedure name field of the Display Module Information display. If *NONE is specified in the field, this module does not have a PEP. If a name is specified in the field, this module has a PEP.