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