sysVar.handleOverflow
The system variable sysVar.handleOverflow controls error processing after an arithmetic overflow. Two types of overflow conditions are detected:
- User variable overflow occurs when the result of an arithmetic operation or assignment to a numeric item causes a significant value (not decimal positions) to be lost due to the length of the item.
- Maximum value overflow occurs when the result of an arithmetic operation is greater than 18 digits.
You can set sysVar.handleOverflow to one of the following values. (The default setting is 0.)
Value Effect on user overflow Effect on maximum value overflow 0 The program sets the system variable sysVar.overflowIndicator to 1 and continues The program ends with an error message 1 The program ends with an error message The program ends with an error message 2 The program sets the system variable sysVar.overflowIndicator to 1 and continues The program sets the system variable sysVar.overflowIndicator to 1 and continues You can use sysVar.handleOverflow in these ways:
- As the source or target in an assignment or move statement (also allowed in the "for count" of a move statement)
- As a variable in a logical expression
- As the argument in an exit or return statement
The characteristics of sysVar.handleOverflow are as follows:
- Primitive type
- NUM
- Data length
- 1
- Is value always restored after a converse?
- Yes
Example
sysVar.handleOverflow = 2;
Related reference
Assignments
Exception handling and status (system words)
sysVar.overflowIndicator