If you do not use V6 exception mode, variable overflow causes EGL to throw a RuntimeException.
If an overflow occurs during an assignment and you are handling overflows, the target variable is assigned a portion of the source value.
You can set vgVar.handleOverflow to one of the values in the following table:
| Value | Effect |
|---|---|
| 0 (the default value) | The EGL runtime code sets the sysVar.overflowIndicator system variable to 1 and continues. You can override the default value for vgVar.handleOverflow by using the symbolic parameter HANDLEOVERFLOW during COBOL generation. For more information, see “Predefined symbolic parameters that can be set by the user.” |
| 1 | EGL throws a RuntimeException. |
| 2 | The EGL runtime code sets the sysVar.overflowIndicator system variable to 1 and continues. This value has the same effect as 0 and is maintained for compatibility with earlier versions. |
The following example shows the vgVar.handleOverflow variable:
vgVar.handleOverflow = 1;
| Platform | Issue |
|---|---|
| COBOL generation | vgVar.handleOverflow is
ignored unless you set the checkNumericOverflow build
descriptor option to YES. If you set checkNumericOverflow to
NO and use the V6 exception mode, the program ends if either type
of overflow occurs. You can use the symbolic parameter HANDLEOVERFLOW to change the default value for vgVar.handleOverflow. |