NET/MASTER Network Control Language (NCL) Reference Manual
&SYS.ERROR.NAME
System Variables
106126 Tandem Computers Incorporated 5–25
&SYS.ERROR.NAME The &SYS.ERROR.NAME system variable contains the name specification that caused
the error. In the case of an error raised because of substitution problems, this is the
name specification before substitution. In the case of an assignment to an unknown
system variable, the name is the illegal target variable name.
This system variable can be used only in an ON error handler.
&SYS.ERROR.NAME
Considerations
NCL returns a null value if this variable is not relevant to the particular error. A
null value is also returned if the names resulting from a VARS list are in error. For
information on VARS lists, see Section 11, “Verb Syntax and Variable Access
Methods.”
See also the other &SYS.ERROR system variables.
Example
In the following example, an error handler is coded specifically to trap variable
assignment errors:
ONPROC: PROCEDURE
ON VARIABLE_ERROR DO
WRITE DATA="ERROR IN TRYING TO ASSIGN A VARIABLE TO",
&SYS.ERROR.NAME
RESUME
END
&A=10
&B =&SYS.&A
END ONPROC
In the previous example, the error occurs because of an attempt to assign a variable
(&B) to a nonexistent system variable (&SYS.&A). The procedure displays the variable
&SYS.&A, which does not exist.