View previous topic :: View next topic
|
Author |
Message |
Manojtyagi1979
New User
Joined: 25 Jan 2010 Posts: 11 Location: Noida
|
|
|
|
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 |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Please check with:
and let us know if you need additional help.... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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
speleotrove.com/decimal/#decNumber |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What kind of number do you have that uses 24 digits before the decimal point. . .? |
|
Back to top |
|
|
Manojtyagi1979
New User
Joined: 25 Jan 2010 Posts: 11 Location: Noida
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
Do you have any solution. |
there are solutions, but not off the shelf |
|
Back to top |
|
|
|