MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cobol Numeric limit

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
saurabh
Beginner


Joined: 25 Sep 2007
Posts: 5
Topics: 4

PostPosted: Tue Dec 04, 2007 12:16 am    Post subject: Cobol Numeric limit Reply with quote

I have a requirement to have a S9(21)V9(10) field in a cobol program. It has to accumulate values.
The following post has a solution for this.

http://www.mvsforums.com/helpboards/viewtopic.php?p=8586#8586

Problem is that at my place the compiler is IBM VS COBOL II Release 4.0 .
Is there any other way that i can get around this limit of 18 digits .

Thanks
Saurabh
Back to top
View user's profile Send private message
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Tue Dec 04, 2007 3:09 pm    Post subject: Reply with quote

Look at the last post in the above thread. It mentions dividing up the 31 place digits you have into smaller sections then treating each section individually carrying any overflow into the adjoining section. In this case, one section can be the decimal portion V9(10) and the S9(21) can be split into 2 sections, one of 10 digits and the other of 11.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
saurabh
Beginner


Joined: 25 Sep 2007
Posts: 5
Topics: 4

PostPosted: Thu Dec 06, 2007 5:54 am    Post subject: Reply with quote

Terry

Did you mean that when 9(11) gets filled up add the value of overflow to initialised section 9(10) ? Correct me if I am wrong .

I guess these splitting would work for counters where the increment is by 1 . For my case the splitted sections may reach a stage during processing where the number added to the first section causes a overflow by a huge margin . This because the values added to this field will be in the range ( 3 - 10 ) digits .

Saurabh
Back to top
View user's profile Send private message
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Thu Dec 06, 2007 9:56 am    Post subject: Reply with quote

Yes, that seems like it should work. Test it with some sample numbers. I'd define both the 10-digit section and the 11-digit section each as 18-digit sections to allow for large overflows from one section to the next. I don't have access to a mainframe currently.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group