NET/MASTER Network Control Language (NCL) Reference Manual
&SYS.ERROR.SUBNAME
System Variables
106126 Tandem Computers Incorporated 5–31
&SYS.ERROR.SUBNAME
The &SYS.ERROR.SUBNAME system variable contains the name of a variable that
caused an error. In the case of an error raised because of substitution problems, this is
the name of the variable after 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.SUBNAME
Consideration
See also &SYS.ERROR.NAME, which provides the name of a variable in error before
substitution.
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.SUBNAME
RESUME
END
&A=123A
&B =&&A
END ONPROC
In the previous example, the error occurs because of an attempt to assign a variable
(&B) to an illegal variable (&&A). The procedure displays the variable 123A, which is
illegal.