Error Trapping
Using the “ON” statement, you can set
multiple levels of error trapping:
$ ON WARNING THEN statement
$ ON ERROR THEN statement
$ ON SEVERE_ERROR THEN statement
$ ON CONTROL_Y THEN statement
Turn error trapping off or on:
Notes:
Through the use of the “ON” statement and the “SET ON” and “SET NOON” statements, you can control how DCL behaves when various type of errors or events occur.
A WARNING event occurs when the severity is zero(0) (($STATUS .AND. 7) .EQ. 0).
An ERROR event occurs when the severity is two(2) (($STATUS .AND. 7) .EQ. 2).
A SEVERE ERROR event occurs when the severity is four(4) (($STATUS .AND. 7) .EQ. 4).