Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

Condition prefixes

Scope of the condition prefix
Raising conditions with OPTIMIZATION

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.

Read syntax diagramSkip visual syntax diagram   .------------------------.
   |    .-,---------.       |
   V    V           |       |
>>---(----condition-+--)--:-+--+-statement-+-------------------><
                               '-;---------'
 
condition
Some conditions are always enabled, and cannot be disabled. Some are enabled unless you disable them, and some are disabled unless you enable them. The conditions are listed in Conditions.
statement
Condition prefixes are not valid for DECLARE, DEFAULT, FORMAT, OTHERWISE, END, ELSE, ENTRY, and %statements. For information on the scope of condition prefixes, refer to Scope of the 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.

Table 44. Classes and status of conditions
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.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)