The SIGNAL statement causes a condition to enable a user to execute an ON-unit.
SIGNAL Statement
| Component | Description |
|---|---|
condition |
Condition. For more information, refer to Conditions. |
If an ON-unit is registered by a user, the ON-unit will be executed. If there are none, a default action specified internally will be executed.
In the following example, an ON-unit using a SIGNAL statement has been executed:
ON ZERODIVIDE
BEGIN;
DISPLAY('ZERODIVIDE condition occurs.');
END;
SIGNAL ZERODIVIDE;
The ON-unit of the ZERODIVIDE condition is executed because of the SIGNAL statement. Even though a condition related to I/O has occurred, the corresponding ON-unit is not executed if the relevant files are different.