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:
- If you provide more than one ENTRY statement, the main entry point specified on the last statement is used.
- In an overlay program, the first instruction to be executed must be in the root segment.
- The external name specified must be a name associated with an instruction, not data, if the module is executed.
- 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 the module contains multiple text classes, the primary and all alternate entry points must be defined in the same class.