Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

PROCEDURE and ENTRY statements

A procedure (subroutine or function) can have one or more entry points. The primary entry point to a procedure is established by the leftmost label of the procedure statement. Secondary entry points to a procedure are established by additional labels on the PROCEDURE statement and by the ENTRY statement. Each entry point has an entry name. See INTERNAL and EXTERNAL attributes for a discussion of the rules for the creation of an external name.

A PROCEDURE statement identifies the procedure as a main procedure, a subroutine, or a function. Parameters expected by the procedure and other characteristics are also specified on the PROCEDURE statement.

Read syntax diagramSkip visual syntax diagram   .--------------.
   V              |
>>---entry-label:-+--PROCEDURE--+-------------------+----------->
                                |   .-,---------.   |
                                |   V           |   |
                                '-(---parameter-+-)-'
 
>--+----------------+--+------------------+--+-----------+------>
   '-returns-option-'  '-OPTIONS(options)-'  '-RECURSIVE-'
 
                           .------------------------.
                           V                        |
>--+-----------------+--;----+-statement----------+-+----------->
   '-scope-attribute-'       +-group--------------+
                             +-internal-procedure-+
                             '-begin-block--------'
 
>--END--+-------------+--;-------------------------------------><
        '-entry-label-'
 

Abbreviations: PROC for PROCEDURE

entry-label
The entry point to the procedure. External entries are explicitly declared in the invoking procedure. If multiple entry labels are specified, the leftmost name is the primary entry point and is the name returned by the PROCNAME and ONLOC built-in functions. For more information on entry data, refer to Entry data.
parameter
Refer to Parameter attribute and Passing arguments to procedures.
returns-option
Applies only to function procedures. Refer to Functions and RETURNS option and attribute.
OPTIONS option
Refer to OPTIONS option and attribute.
RECURSIVE
Refer to Recursive procedures.
scope-attribute
Refer to Scope of declarations.

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)