NET/MASTER Network Control Language (NCL) Reference Manual

&SYS.ERROR.STMT
System Variables
106126 Tandem Computers Incorporated 5–29
&SYS.ERROR.STMT The &SYS.ERROR.STMT system variable contains the statement number that caused
the error to be issued.
This system variable can be used only in an ON error handler.
&SYS.ERROR.STMT
Considerations
The value of &SYS.ERROR.STMT is counted from the beginning of the line in
which the error occurred.
See also &SYS.ERROR.LINE, which contains the line number in which the bad
statement appears.
Example
The following procedure named ONPROC contains an error. The error handler
displays information that can help you find the error. It displays the statement
number (&SYS.ERROR.STMT) within the line (&SYS.ERROR.LINE) for the procedure
that contains the error:
ONPROC: PROCEDURE
ON ERROR DO
WRITE DATA="AN ERROR OCCURRED IN STATEMENT NUMBER",
&SYS.ERROR.STMT,
"IN LINE " &SYS.ERROR.LINE
RESUME
END
&COL=OOPS
WRITE COLOR=&COL DATA="THIS IS TEST TEXT"
END ONPROC