OUTPUT PROCEDURE Phrase
- procedure-name-3
- Specifies the first (or only) section or paragraph in the output procedure.
- procedure-name-4
- Identifies the last section or paragraph in the output procedure.
The output procedure may consist of any procedure needed to select, modify, or copy the records that are made available one at a time by the RETURN statement in sorted order from file-name-1. The range of the output procedure includes all statements that are executed as the result of a transfer of control by CALL, EXIT, GO TO, and PERFORM statements within the output procedure. The range also includes all statements in declarative procedures that are executed as a result of the execution of statements in the range of the output procedure. The range of the output procedure must not include any MERGE, RELEASE, or SORT statement.
As with the PERFORM statement, execution of the procedure ends after the last statement executes. The last statement in an input or output procedure can be the EXIT statement (see EXIT Statement).
IBM Extension The SORT-RETURN special register contains a return code indicating the success (or lack of) of a SORT operation. See SORT-RETURN Special Register for more information. End of IBM Extension