RPG/400 Help

RETRN (Return to Caller)

*---------*---------------*-----------------*----------------*---------------*
|   CODE  |    FACTOR 1   |     FACTOR 2    |     RESULT     |  INDICATORS   |
|         |               |                 |      FIELD     |               |
*---------*---------------*-----------------*----------------*---------------*
| RETRN   |               |                 |                |               |
*---------*---------------*-----------------*----------------*---------------*

The RETRN operation causes a return to the caller as follows:

  1. The halt indicators are checked. If a halt indicator is on, the program ends abnormally. (All open files are closed, an error return code is set to indicate to the calling routine that the program has ended abnormally, and control returns to the calling routine.)
  2. If no halt indicators are on, the LR indicator is checked. If LR is on, the program ends normally. (Locked data area structures, arrays, and tables are written, and external indicators are reset.)
  3. If no halt indicator is on and LR is not on, the program returns to the calling routine. Data is preserved for the next time the program is run. Files and data areas are not written out.


[ Top of Page | Previous Page | Next Page | Table of Contents ]