NET/MASTER Network Control Language (NCL) Reference Manual
&SYS.ERROR.VALUE2
System Variables
106126 Tandem Computers Incorporated 5–35
&SYS.ERROR.VALUE2 The &SYS.ERROR.VALUE2 system variable contains a second value that caused the
error to be issued. It is set only if two combined values cause the error (for example, in
string concatenation or in a multiplication operation).
This system variable can be used only in an ON error handler.
&SYS.ERROR.VALUE2
Considerations
If a mathematical operation contains more than two values, the first two values
that cause an error are returned in &SYS.ERROR.VALUE and
&SYS.ERROR.VALUE2. For example, the operation (2*3)+4 would return 2 and 3
as the values for the system variables, if the multiplication was in error. If the
addition was in error the values of the variables would be 6 (multiplication of 2*3
resolved) and 4.
See also &SYS.ERROR.VALUE, &SYS.ERROR.VALUEOK, and
&SYS.ERROR.VALUE2OK. These system variables either hold the value(s) that
caused the error or indicate that such error information is available.
Example
In the following example, the procedure ONPROC contains an arithmetic error. It
displays the value that caused the error. In this example, there are two values that can
cause the error: 10 and 0 (zero). The &SYS.ERROR.VALUE2 system variable contains
the second of the two values (if there are two values) as in this example. The value 0
(zero) is displayed:
ONPROC: PROCEDURE
ON ERROR DO
WRITE DATA="THE VALUE OF &SYS.ERROR.VALUE2 IS ",
&SYS.ERROR.VALUE2
RESUME
END
&A=10
&B=0
&C = &A / &B
END ONPROC