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.
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:
|