NET/MASTER Network Control Language (NCL) Reference Manual

&SYS.ERROR.COND
System Variables
5–20 106126 Tandem Computers Incorporated
&SYS.ERROR.COND The &SYS.ERROR.COND system variable contains the name of the condition or error
that was issued. This variable is also set if the user signals a user-defined error
condition that has no specific error handler associated with it.
This system variable can be used only in an ON error handler.
&SYS.ERROR.COND
Considerations
For a list of system-defined error condition names and NCL error codes, see Table
2-3 in Section 2, “Core Statements.”
See also the other &SYS.ERROR system variables.
For a full list of all NCL error codes, refer to the NonStop NET/MASTER Messages
Manual.
Examples
The following example is a procedure that contains an error. The error handler
displays &SYS.ERROR.COND, which indicates an arithmetic error. The value
displayed is ARITH_ERROR:
ONPROC: PROCEDURE
ON ERROR DO
WRITE DATA="A TYPE" &SYS.ERROR.COND "ERROR OCCURRED"
RESUME
END
&A=10
&B=0
&C = &A / &B
END ONPROC
The following example is a procedure that displays &SYS.ERROR.COND after raising
a user-specified condition called SIG_ERROR with the SIGNAL core statement. The
value displayed is SIG_ERROR:
ONPROC: PROCEDURE
ON SIG_ERROR DO
WRITE DATA="A TYPE" &SYS.ERROR.COND "ERROR OCCURRED"
RESUME
END
SIGNAL SIG_ERROR
END ONPROC