View previous topic :: View next topic
|
Author |
Message |
aru_bec
New User
Joined: 23 Dec 2005 Posts: 19 Location: Bangalore
|
|
|
|
All,
I am calling a DB2 stored proc from Cobol program. One of the field in result set is Decimal (20,10). As cobol can store only upto 18 bytes how to declare a corresponding Cobol variable for this?
Please help me to resolve this issue.
Thanks,
Aru |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Change the compiler option:
Quote: |
When you specify ARITH(EXTEND):
* The maximum number of digit positions that you can specify in the PICTURE clause for packed-decimal, zoned-decimal, and numeric-edited data items is raised from 18 to 31.
* The maximum number of digits that you can specify in a fixed-point numeric literal is raised from 18 to 31. You can use numeric literals with large precision anywhere that numeric literals are currently allowed, including:
o Operands of PROCEDURE DIVISION statements
o VALUE clauses (on numeric data items with large-precision PICTURE)
o Condition-name values (on numeric data items with large-precision PICTURE)
* The maximum number of digits that you can specify in the arguments to NUMVAL and NUMVAL-C is raised from 18 to 31.
* The maximum value of the integer argument to the FACTORIAL function is 29.
* Intermediate results in arithmetic statements use extended mode. |
|
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Declare the variable in COBOL as S9(10)v9(10) and use ARITH(EXTEND) option during compilation as suggested by Robert. |
|
Back to top |
|
|
|