HP RPG/XL Programmer's Guide (30318-90001)

7-: 4
Figure 7-3. An RPG Execution Error
Changing the Way RPG Errors Are Handled
Normally, when an RPG error occurs, a message is displayed and the user
(or console operator) selects a particular action to take. The operator
can ignore the error and continue, skip the line in error and continue or
terminate the program. If you do not want the operator or user to make
these choices for specific error situations, you can enter the actions to
take within your program. You can do this using either (or both) the
Header Specification or the *ERROR field.
Use the Header Specification to enter the responses you want RPG to make
when an error occurs. For instance, you might want the operator to
handle errors except when an input file sequence error occurs. When
input sequence errors occur, you want to continue processing and use your
own error handling instead. (Use the *ERROR field to find out the error
number, then code your own RPG operations to handle the error.) Figure
7-4 shows a Header Specification that suppresses normal RPG processing
for input file sequence errors (the program includes code to handle these
errors).
Figure 7-4. Providing a Response to RPG Errors Using the Header Specification