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
 

 

Can we have variable of Size 38 digits in COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Manojtyagi1979

New User


Joined: 25 Jan 2010
Posts: 11
Location: Noida

PostPosted: Fri May 28, 2010 12:27 pm    Post subject: Can we have variable of Size 38 digits in COBOL
Reply with quote

Hi,

I have requirement to store numeric data of 38 digits (with 14 digits after decimal point) in COBOL ?

Can this be done in COBOL in any way. Can COMP-2 help in any way.

I know that most of the compiler allow numeric data of 18 digits only.

Still looking for any solution.

Regards
Manoj Tyagi
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri May 28, 2010 12:56 pm    Post subject:
Reply with quote

Please check with:
In Appendix B. Compiler limits, Enterprise COBOL for z/OS V4.2 Language Reference wrote:
PICTURE clause, numeric item digit positions:
With ARITH(COMPAT): 18;
With ARITH(EXTEND): 31.
and let us know if you need additional help....
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Fri May 28, 2010 1:07 pm    Post subject: Reply to: Can we have variable of Size 38 digits in COBOL
Reply with quote

as already said in a different topic on a similar issue... good luck !

even with the most modern cobol option ARITH(EXTEND) You will be able to manage at most 31 digits!

some of the powers of Your organization should review the requirements
or plan to acquire/write in house <something> for very large number processing

along the lines of
http://speleotrove.com/decimal/#decNumber
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri May 28, 2010 8:12 pm    Post subject:
Reply with quote

Hello,

What kind of number do you have that uses 24 digits before the decimal point. . .?
Back to top
View user's profile Send private message
Manojtyagi1979

New User


Joined: 25 Jan 2010
Posts: 11
Location: Noida

PostPosted: Tue Jun 01, 2010 7:22 pm    Post subject:
Reply with quote

Hi Dick,

Client has some requirement of having this big Amount field.

Do you have any solution.

Thanks in advance.


regards
manoj
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: Tue Jun 01, 2010 7:27 pm    Post subject:
Reply with quote

You can treat the variable as alphanumeric -- as long as there is no need to perform arithmetic operations on the variable. You can break it into two fields, each less than 31 bytes in length (digits before and after the decimal point, for example). This would complicate arithmetic but it would be possible. Or, you can look for a language other than COBOL to use. There is categorically no way to handle a 38-byte field as a single numeric variable in COBOL, period.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Jun 01, 2010 7:39 pm    Post subject:
Reply with quote

Hello,

Quote:
Client has some requirement of having this big Amount field.
What is the requirement? What exactly will this field contain? How will it be used?

I ask because this has come up several places i have been and the reason such a large field was needed was due to misunderstanding. Just because there is a belief does not mean there is a requirement in fact. . .
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Tue Jun 01, 2010 7:39 pm    Post subject: Reply to: Can we have variable of Size 38 digits in COBOL
Reply with quote

Quote:
Do you have any solution.


there are solutions, but not off the shelf
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 -> COBOL Programming 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 Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am


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