ENTRY statement

The ENTRY statement specifies the symbolic name of the first instruction to be executed when the program is called by its module (member) name for execution or by an alias that does not match an executable external symbol. An ENTRY statement should be used whenever a module is reprocessed by the binder. The syntax of the ENTRY statement is:

ENTRY          externalsymbol
externalsymbol
Defined as either a control section name or an entry name in an input module.
Placement: An ENTRY statement can be placed before, between, or after object modules or other control statements. It must precede the NAME statement for the module, if one is present.
Note:
  1. If you provide more than one ENTRY statement, the main entry point specified on the last statement is used.
  2. In an overlay program, the first instruction to be executed must be in the root segment.
  3. The external name specified must be a name associated with an instruction, not data, if the module is executed.
  4. The order of precedence for determining the entry point is (from highest to lowest):
    • The ENTRY control statement or EP option specified on a SETOPT control statement
    • An entry point specified as an EP option in the PARM field of an EXEC statement or in a file processed as a result of the OPTIONS option in the PARM field
    • An entry point specified on an END statement of an object module
    If none of the above is present, the entry point defaults to either CEESTART if DYNAM=DLL and CEESTART exists, or the first byte of the first control section in the program. If the module contains multiple text classes and an entry point is not specified, the results are not predictable.
  5. If the module contains multiple text classes, the primary and all alternate entry points must be defined in the same class.