You can use the halt indicators (H1 through H9) to indicate errors
that occur during the running of a program. The halt indicators can
be set on as record identifying indicators, field indicators, or resulting
indicators.
The halt indicators are tested at the *GETIN step of the
RPG IV cycle
(see
RPG Cycle and other implicit Logic). If a halt indicator is on, a message
is issued to the user. The following responses are valid:
- Set off the halt indicator and continue the program.
- Issue a dump and end the program.
- End the program with no dump.
If a halt indicator is on when a RETURN operation inside
a cycle-main procedure is processed, or when the LR indicator
is on, the called program ends abnormally. The calling program is
informed that the called program ended with a halt indicator on.
Note: If the keyword MAIN or NOMAIN is specified on
a control specification, then any halt indicators are ignored except
as conditioning indicators.
For a detailed description of the steps that occur when a halt
indicator is on, see the detailed flowchart of the RPG IV cycle
in RPG Cycle and other implicit Logic.