Purpose
Returns a fixed-point binary integer that is the status value of the most recent run-time error that signaled the current ON condition.
Syntax
ONCODE()
or
ONCODE
The second syntax form can be used only when the BUILTIN attribute is specified.
Examples
ON ERROR BEGIN;
PUT EDIT ('ERROR NUMBER', ONCODE()) (SKIP, A, F(10));
END;
Description
The ONCODE function returns a binary integer that is the status value of the most recent run-time error that signaled the current ON condition. The result has an implementation-defined precision. (For details on precisions, see your Open PL/I User's Guide.) The ONCODE function can be used in any ON-unit to ascertain the exact error that caused the condition. Used within any context other than an ON-unit, the ONCODE function returns a zero.
See Table of values returned by ONCODE in the Open PL/I User's Guide for the values of the run-time errors that signal particular ON conditions.