You can specify whether or not some conditions are enabled or disabled. If a condition is enabled, the compiler generates any extra code needed in order to detect the condition. If a condition is disabled, the compiler generates no extra code to detect it.
Disabling a condition is equivalent to asserting that the condition cannot occur; if it does, your program is in error.
For instance, if the SUBSCRIPTRANGE condition is enabled, the compiler generates extra code to ensure that any array index is within the bounds of its array. If the SUBSCRIPTRANGE condition is disabled, the extra code is not generated and using an invalid array index leads to unpredictable results.
If a condition is detected by hardware, disabling the condition has no effect.
Enabling and disabling can be specified for the eligible conditions by a condition prefix.
|
In the following example (size): is the condition prefix. The conditional prefix indicates that the corresponding condition is enabled within the scope of the prefix.
(size): L1: X=(I**N) / (M+L);
Conditions can be enabled using the condition prefix specifying the condition name. They can be disabled using the condition prefix specifying the condition name preceded by NO without intervening blanks. Types and status of conditions are shown in Table 44.
| Class and conditions | Status |
|---|---|
| Computational (for data handling, expression evaluation, and computation) | |
| CONVERSION | Enabled by default |
| FIXEDOVERFLOW | Enabled by default |
| INVALIDOP | Enabled by default |
| OVERFLOW | Enabled by default |
| UNDERFLOW | Always enabled |
| ZERODIVIDE | Enabled by default |
| Input/Output | |
| ENDFILE | Always enabled |
| ENDPAGE | Always enabled |
| KEY | Always enabled |
| NAME | Always enabled |
| RECORD | Always enabled |
| TRANSMIT | Always enabled |
| UNDEFINEDFILE | Always enabled |
| Program checkout (useful for developing/debugging a program) | |
| SIZE | Disabled by default |
| STRINGRANGE | Disabled by default |
| STRINGSIZE | Disabled by default |
| SUBSCRIPTRANGE | Disabled by default |
| Miscellaneous | |
| ANYCONDITION | Always enabled |
| AREA | Always enabled |
| ATTENTION | Always enabled |
| CONDITION | Always enabled |
| ERROR | Always enabled |
| FINISH | Always enabled |
| STORAGE | Always enabled |
For information about the performance effects of enabling and disabling conditions, refer to the Programming Guide.