ENTRY statement
The ENTRY statement establishes an alternate entry point into a COBOL called
subprogram.
The ENTRY statement cannot be used in:
- Programs that specify a return value using the procedure division
RETURNING phrase. For details, see the discussion of the RETURNING phrase
under The procedure division header.
- Nested program. See Nested programs for
a description of nested programs.
When a CALL statement that specifies the alternate entry point is executed in a
calling program, control is transferred to the next executable statement
following the ENTRY statement.
| Format |
 >>-ENTRY--literal-1--------------------------------------------->
>--+--------------------------------------------------------+--->
| .---------------------------------------------. |
| | .--------------. | |
| V V | | |
'-USING------+-------------------+----identifier-1-+---+-'
+-+----+--REFERENCE-+
| '-BY-' |
'-+----+--VALUE-----'
'-BY-'
>--.-----------------------------------------------------------><
|
- literal-1
- Must be an alphanumeric literal that conform to the rules for the
formation of a program-name in an outermost program (see PROGRAM-ID paragraph).
Must not match the program-ID or any other ENTRY literal in this program.
Must not be a figurative constant.
Execution of the called program begins at the first executable statement
following the ENTRY statement whose literal corresponds to the literal or
identifier specified in the CALL statement.
The entry point name on the ENTRY statement can be affected by the PGMNAME
compiler option. For details, see the
COBOL for Windows Programming Guide.
USING phrase
For a discussion of the USING phrase, see The procedure division header.
|