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: 8117
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
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
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


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