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

Can we have variable of Size 38 digits in COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 2146
Location: At my coffee table

PostPosted: Fri May 28, 2010 12:56 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri May 28, 2010 1:07 pm
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
speleotrove.com/decimal/#decNumber
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri May 28, 2010 8:12 pm
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jun 01, 2010 7:27 pm
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

Moderator Emeritus


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

PostPosted: Tue Jun 01, 2010 7:39 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jun 01, 2010 7:39 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


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