NET/MASTER Network Control Language (NCL) Programmer's Guide
Writing an Error Handler
Run-Time Error Handling
7–6 106160 Tandem Computers Incorporated
Note The order in which multiple error handlers are declared is not significant to NCL when they are executed
one after the other in a block of statements.
Writing the Statement to
Process the Error
Once NCL has trapped an error, it processes the error according to the statement
following the specified condition.
Taking Standard System Action After an Error
You can direct NCL to take standard system action (termination of the NCL process)
when it detects an error by using the SYSTEM keyword following the keyword that
specifies the error condition. Using the SYSTEM keyword also nullifies the current
error handler for the specified error condition (if one is active).
The following example directs NCL to take standard system action for the ERROR
error handler when it detects an error:
zex0702n: PROCEDURE
/* Taking standard system action */
ON ERROR SYSTEM
SAY &1" divided by "&2" is "&1/&2
SAY Normal termination
END zex0702n
The following screen shows the results of attempting to execute the procedure twice:
(13:51) --------------------- OPERATOR CONTROL SERVICES ----------------------
START ZEX0702N 10 2
10 divided by 2 is 5
Normal termination
NNM1005 START ZEX0702N PROCESSING COMPLETE. NCLID 002036
START ZEX0702N 10 A
NNM1004 NCLID 002037: ZEX0702N 4 ERROR TYPE_ERROR CODE 4
_____________________________________________________________________________
---------- ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>
The values entered are 10 and 2 (correctly), and 10 and A (incorrectly). When NCL
detects an error, it takes standard system action and terminates execution of the NCL
process.