Always enabled.
Enables you to establish an ON-unit that is executed when a SIGNAL statement for the appropriate CONDITION condition is executed.
By a SIGNAL statement, where the name of the SIGNAL statement matches a condition name, and thus specifies which condition is raised. The program can execute the ON-unit from any point, and then through placement of a SIGNAL statement.
You can use CONDITION condition as a debugging aid to establish an ON-unit that prints information about the current status of the program.
Normal rules of name scope apply. A condition name is external by default, but can be declared INTERNAL.
This condition allows the user to establish an ON-unit that will be executed whenever a SIGNAL statement is executed specifying CONDITION and a name that matches the name in the ON statement.
The following is an example of an ON CONDITION statement:
ON CONDITION(OVERDRAFT) BEGIN; PUT SKIP LIST('ACCOUNT HAD AN OVERDRAFT ON'||DATE())'); END; . . . IF ACCOUNT_BALANCE < TOTAL WITHDRAWAL THEN SIGNAL CONDITION(OVERDRAFT);