SUBROUTINE RETURN POINTS


RPG subroutines normally return to the point in the RPG program at which they were called. There are certain conditions, however, when the return point must be controlled from within the subroutine. This kind of control is often needed when handling an error or exception event in the RPG program. Table 1.15 lists subroutine return points supported by the RPG IV language.

Table 1.15: *PSSR and INFSR Return Points

Routine

Description

*CANCL

Cancel the program.

*DETC

Return to detail-time calculations.

*DETL

Return to detail-time lines (i.e., detail output).

*GETIN

Return to the next "get in" cycle.

*NEXT

Return to the statement following the one in which the error occurred.

*OFL

Return to the overflow output-time portion of the cycle.

*TOTC

Return to total-time calculations.

*TOTL

Return to total-time lines (i.e., total-time output).

Blanks

If the *PSSR or INFSR subroutines were called by the EXSR or CASxx operation, control returns to the statement following the EXSR or CASxx operation. If the RPG exception/error handler called the subroutine, the following applies:

  • If the error status code is 1121 to 1126, control returns to the operation where the error occurred.

  • Any other error status code causes an exception to be issued and the requester is notified (i.e., a message is sent to the user).




The Modern RPG IV Language
The Modern RPG IV Language
ISBN: 1583470646
EAN: 2147483647
Year: 2003
Pages: 156
Authors: Robert Cozzi

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net