NET/MASTER Network Control Language (NCL) Programmer's Guide
Raising an Error Handler
Run-Time Error Handling
106160 Tandem Computers Incorporated 7–15
Raising an Error
Handler
Once the error handler is set, the error condition for which it is set can be raised in two
ways: automatically by NCL or explicitly by using the SIGNAL core statement.
Using NCL to Raise an Error Handler Automatically
NCL can raise an error handler at any time during the course of NCL process
execution when it detects an error. The following steps summarize the action that
NCL takes:
1. NCL attempts to find a specific error handler, such as TYPE_ERROR,
ARITH_ERROR, and so on.
2. If NCL cannot find a specific error handler, it attempts to find the general error
handler, ERROR.
3. If NCL cannot find the general error handler, it terminates execution of the NCL
process.
At any point, if NCL finds the error handler it is looking for, it passes control to it.
How NCL searches for an error handler is described later in this section.
Using the SIGNAL Statement to Explicitly Raise an Error
You can use an explicit SIGNAL core statement to raise an error yourself if a certain
condition occurs. The following example uses the SIGNAL core statement to explicitly
raise an error handler:
proc1: PROCEDURE
ON FATAL_ERROR DO
SAY Fatal error
INTCMD "SHUTDOWN $ABEND$"
EXIT
END /*do*/
…
SIGNAL FATAL_ERROR
…
END proc1