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.
.--------------. V | >>---entry-label:-+--PROCEDURE--+-----------------------+-------> | .-,-------------. | | V | | '-(---+-----------+-+-)-' '-parameter-' >--+----------------+--+------------------+--+-----------+------> '-returns-option-' '-OPTIONS(options)-' '-RECURSIVE-' >--+----------------------------+--+-----------------+--;-------> '-EXTERNAL(environment-name)-' '-scope-attribute-' .------------------------. V | >----+-statement----------+-+--END--+-------------+--;--------->< +-group--------------+ '-entry-label-' +-internal-procedure-+ '-begin-block--------'
Abbreviations: PROC for PROCEDURE
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.