In your COBOL programs where you need to summarize the amounts from a table based on region and convert the amounts into different currency, you would create a DB2 cursor to group by all the rows within a region and multiple by the currency factor to get the Total amount (in new currency). Chances are that the Total amount might exceed the precision set by DB2. And at this point you will encounter this issue. You need to either correct the calculation used for amount or change the DB2 precision, so it can handle larger amounts.
The default for precision depends on the data type of numeric-expression:
31 for decimal floating-point
15 for floating-point and decimal
19 for big integer
11 for large integer
5 for small integer.
A value derived or calculated during processing of the SQL statement was outside the range of the data type of its object column. This problem might have arisen for one of the following reasons:
The values occurring in the object column were out of range.
The SQL operation performed was not appropriate for the values in the object column.
A DECIMAL(19,0) column is altered to BIGINT, but a value in the column is outside the range of BIGINT.
The statement cannot be processed.
See the explanation of SQLCODE -405 for allowed ranges for numeric data types.
If the error occurred while accessing a table column that was altered from DECIMAL(19,0) to BIGINT, alter the column data type back to DECIMAL(19,0) and refer description of the ALTER TABLE statement for information about how to change DECIMAL(19,0) columns to BIGINT.
If you would like to Earn Free Stocks, Credit card Points and Bank account Bonuses, Please visit My Finance Blog
You may also like to look at: