Always enabled.
Issues an error messages if no ON-unit is active when the ERROR condition arises, or if the ON-unit does not use a GOTO (to exit the block) to recover from the condition.
The ERROR condition is the implicit action for many conditions, thus providing a common condition that can be used to check for a number of different conditions, rather than checking each condition separately.
Just prior to signaling the condition, the value of the ONCODE built-in function is set to an implementation-defined integer value that serves as an error code that indicates which error occurred. (For more information, see your Open PL/I User's Guide.)
The following is an example of an ON ERROR statement.
ON ERROR BEGIN; PUT SKIP LIST ('AN UNIDENTIFIED ERROR OCCURRED'); END;