On Size Error in Cobol?
In Visual Cobol, the on Size Error Condition Exists When the Value Resulting from an Arithmetic Operation Exceeds the Capacity of the Specified Picture-String...
In Visual COBOL, the ON SIZE ERROR condition exists when the value resulting from an arithmetic operation exceeds the capacity of the specified picture-string. In RM/COBOL, the ON SIZE ERROR condition exists when the value resulting from an arithmetic operation exceeds the capacity for the associated data item.
How does Cobol handle size error?
Because COBOL continues execution even if a size error occurs, a size error can cause a loop or processing result error at execution. To prevent such problems, the ON SIZE ERROR phrase can be used to clearly define the operation to be executed when a size error occurs.
What kind of error is trapped by on size error option?
ON SIZE ERROR happens in situations when the result of the arithmetic operation is larger than the fixed point field. It also happens when it is divisible by 0. Other situations that result in ON SIZE ERRORS are zero raised to zero, zero raised to some negative number or a negative number raised to a fractional power.