COBOL Manual for TNS and TNS/R Programs

Run-Time Diagnostic Messages
HP COBOL Manual for TNS and TNS/R Programs522555-006
48-8
Arithmetic Overflow
Arithmetic Overflow
Arithmetic overflow means that an arithmetic operation resulted in an arithmetic
overflow. Typical causes include:
Invalid data is associated with an item, such as an uninitialized USAGE
COMPUTATIONAL or index item.
A receiving item in an arithmetic statement is too small.
An intermediate result in a COMPUTE statement exceeds the 36-digit maximum.
A USAGE COMPUTATIONAL operand in an arithmetic statement contains a
number larger than the number of digits specified in the PICTURE clause for that
item.
A subscript or a reference modifier is too big.
You can determine the cause of arithmetic overflow in any of these ways:
Without the Debugger
This method is recommended for production runs.
If the program calls the COBOL85^ARMTRAP routine (in the non-CRE
environment) or the PARAM INSPECT OFF command is active (in the CRE), the
process stops executing with a trace-back to the highest-level program. The first
item in the trace-back is the offset within the program of the statement that caused
the problem. To find the statement itself, compile the program with the ICODE
directive (for the COBOL85 compiler) or the INNERLIST directive (for the
NMCOBOL compiler). Except for adding the ICODE or INNERLIST directive,
compile the program with exactly the same directives as you did before the
problem occurred. (Some directives, such as SYMBOLS, can slightly change the
generated code.)
With the Debugger
If the program does not call the COBOL85^ARMTRAP routine (in the non-CRE
environment) or the PARAM INSPECT ON command is active (in the CRE), the
process stops and enters the selected debugger (see Debugger Selection). You
can use the debugger to find the problem. If the selected debugger is symbolic,
using it is easier if you compiled the program with the SYMBOLS directive. If you
did not, you might have to recompile the program with SYMBOLS to find the
problem with the debugger.
With a Saveabend File
If the program is compiled with the SAVEABEND directive, the process generates
a saveabend file if it terminates abnormally. You can determine the cause of the
problem by examining the saveabend file.