SIGNAL

Purpose

Causes a specified condition to be signaled.

Syntax

SIGNAL condition-name;

Parameters

condition-name
ANYCONDITION, AREA, ATTENTION, CONDITION(name), CONVERSION, ENDFILE(f), ENDPAGE(f), ERROR, FINISH, FIXEDOVERFLOW, KEY(f), OVERFLOW, RECORD(f), UNDEFINEDFILE(f), UNDERFLOW, USERCONDITION (expression), USERCONDITION(SS$_UNWIND), VAXCONDITION (expression), or ZERODIVIDE.
Note:

Abbreviations:

  • ATTN for ATTENTION
  • COND for CONDITION
  • CONV for CONVERSION
  • OFL for OVERFLOW
  • UFL for UNDERFLOW
  • UNDF for UNDEFINEDFILE
  • ZDIV for ZERODIVIDE

Description

The SIGNAL statement forces a specified condition to be raised. for detailed information on condition handling, see the section ON Statement.

A signal from a SIGNAL statement or from a condition raised during run-time calls the most recently established ON-unit for the specified condition.

Example

SIGNAL ERROR; 
SIGNAL ENDFILE(F);

Restrictions

The ONCODE built-in function returns the value of the expression in the SIGNAL USERCONDITION (expression) or VAXCONDITION (expression) statement that caused the ON-unit to be invoked. For this reason, take care to choose expression values that do not conflict with any of the values used to indicate system or run-time errors or conditions.

In general, you can avoid conflicts with system and run-time-defined codes by using values greater than or equal to 100000 (one hundred thousand) for user-defined conditions. Code values between 0 and 99999 that are currently unused by the system are reserved for future expansions.