Tags

, , , , , , , , ,

My Details

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.

Explanation
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.

System action
The statement cannot be processed.

Programmer response

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.

SQLSTATE
22003

https://www.ibm.com/support/knowledgecenter/en/SSEPEK_11.0.0/codes/src/tpc/n406.html

https://stackoverflow.com/questions/20794417/db2-sql-updating-a-table-value

https://www.ibm.com/support/knowledgecenter/en/SSEPGG_9.7.0/com.ibm.db2.luw.sql.ref.doc/doc/r0000791.html

——————————————————————————————————–

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:

Working on Mainframes – Is Change to a different technology necessary
Important SQL CODES and ABEND CODES
SORT JOIN – TO JOIN TWO FILES BASED ON A KEY
KNOW YOUR MAINFRAME
REXX – INITIAL SETUP
HOW TO SUBMIT A BATCH JOB FROM THE CICS PROGRAM
CICS – EXEC interface block – EIBRESP Values
CICS – EXEC interface block Fields
Flow of control between COBOL programs, run units, and CICS
CICS INTERVIEW QUESTIONS
CICS TIPS
COBOL – COPY and INCLUDE statements
COBOL – PERFORMANCE IMPROVEMENT
COBOL – SIGN STORED IN COMP, COMP-3 AND DISPLAY FORMATS
SHORTEST COBOL PROGRAM
RESTART LOGIC IN COBOL DB2 Program
GOBACK – EXIT PROGRAM – STOP RUN
Continuation lines in COBOL
Computational items – COMP, COMP 1 , COMP 2, COMP 3
COBOL program format
cobol indicator area column-7 and area a and area b
COBOL INTERVIEW QUESTIONS
COBOL TIPS
COBOL COMPILER OPTIONS
The IDENTIFICATION DIVISION