%ERNUM

Return the number of the most recently trapped error

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
error = %ERNUM

Return value

error

The code number of the error that was most recently trapped. (n)

Discussion

%ERNUM is the same as %ERROR without any of the optional arguments.

Tip

All I/O statements and many subroutines update the value returned by %ERNUM. After you get an error with ONERROR or an I/O error list, we recommend that you use %ERNUM to capture the error immediately, before it is updated by subsequent statements and subroutines, and then store it in a local variable for later processing.

Examples

See %ERLIN Examples.