handleOverflow

If you use V6 exception mode (see “Using V6 exception compatibility”), you can use the vgVar.handleOverflow system variable to specify how EGL handles errors after overflow. In most cases, use the default setting (0) of this variable.
Two types of overflow can occur:

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:

Table 1. Values for handleOverflow
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.
vgVar.handleOverflow has the following characteristics:
Primitive type
NUM
Data length
1
Value saved across segmented converse?
Yes

Example

The following example shows the vgVar.handleOverflow variable:

  vgVar.handleOverflow = 1;

Compatibility considerations

Table 2. Compatibility considerations
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.


Feedback