IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Decimal (20,10) equivalent in Cobol??


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
aru_bec

New User


Joined: 23 Dec 2005
Posts: 19
Location: Bangalore

PostPosted: Thu Oct 30, 2008 7:19 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Oct 30, 2008 7:53 pm
Reply with quote

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
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Fri Oct 31, 2008 11:59 am
Reply with quote

Declare the variable in COBOL as S9(10)v9(10) and use ARITH(EXTEND) option during compilation as suggested by Robert.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top