Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

COBOL Programming :: RE: ROUNDED Problem with COMPUTE statement

$
0
0
Author: Robert Sample
Posted: Thu Feb 09, 2017 9:10 pm (GMT 5.5)

Have you considered making TOP-VALUE and BOTTOM-VALUE V999 instead of V99 and see if that makes a difference? As Terry indicated, the COBOL rules for intermediate results are NOT easy to understand without a LOT of experience. If some of your intermediate results only have 2 decimal places, you're going to get 2 decimal places in the result in most cases.
Quote:
If COBOL does not carry the precision of intermediate results then what is alternate for me.
Possible solution 1: carry more decimal digits after the decimal point so the intermediate results have more digits.
Possible solution 2: break up the calculation into pieces.
_________________
TANSTAAFL

The first rule of code reuse is that the code needs to be worth re-using.

"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." -- Donald Knuth


Viewing all articles
Browse latest Browse all 8500

Trending Articles