View previous topic :: View next topic |
Author |
Message |
saurabh Beginner
Joined: 25 Sep 2007 Posts: 5 Topics: 4
|
Posted: Tue Dec 04, 2007 12:16 am Post subject: Cobol Numeric limit |
|
|
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 |
|
 |
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Tue Dec 04, 2007 3:09 pm Post subject: |
|
|
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 |
|
 |
saurabh Beginner
Joined: 25 Sep 2007 Posts: 5 Topics: 4
|
Posted: Thu Dec 06, 2007 5:54 am Post subject: |
|
|
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 |
|
 |
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Thu Dec 06, 2007 9:56 am Post subject: |
|
|
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 |
|
 |
|
|