Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Decimal (20,10) equivalent in Cobol??

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Decimal (20,10) equivalent in Cobol??
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: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Thu Oct 30, 2008 7:53 pm    Post subject:
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: 356
Location: New York

PostPosted: Fri Oct 31, 2008 11:59 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts COBOL Programming Sandpit? jodrisco COBOL Programming 6 Wed Apr 12, 2017 3:47 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us