Free-Form Syntax | EXSR subroutine-name |
Code | Factor 1 | Factor 2 | Result Field | Indicators | ||
---|---|---|---|---|---|---|
EXSR | subroutine-name |
The EXSR operation causes the RPG IV subroutine named in the subroutine-name operand to be processed. The subroutine name must be a unique symbolic name and must appear as the subroutine-name operand of a BEGSR operation. The EXSR operation can appear anywhere in the calculation specifications. Whenever it appears, the subroutine that is named is processed. After operations in the subroutine are processed, the statement following the EXSR operation is processed, except when a GOTO within the subroutine is given to a label outside the subroutine or when the subroutine is an exception/error subroutine specified by the return-point operand of the ENDSR operation.
*PSSR used in the subroutine-name operand specifies that the program exception/error subroutine is to be processed. *INZSR used in the subroutine-name operand specifies that the program initialization subroutine is to be processed.
See Coding Subroutines, Subroutine Operations, or Compare Operations for more information.