Re: rounding
- From: Louis Krupp <lkrupp@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 02 Oct 2007 00:44:09 -0600
Frank Swarbrick wrote:
Here is some current production code:
77 ADJ-MEMO-CREDITS PIC S9(7)V99 COMP-3.
77 RSRV-ACC-INT PIC S9(6)V999 COMP-3.
77 RSRV-ACC-INT-ROUNDED PIC S9(6)V99 COMP-3.
COMPUTE ADJ-MEMO-CREDITS ROUNDED = ADJ-MEMO-CREDITS - (RSRV-ACC-INT + .005).
<snip>
Interestingly, I can also do this to make it work:
COMPUTE ADJ-MEMO-CREDITS ROUNDED = ADJ-MEMO-CREDITS - RSRV-ACC-INT + .005.
The only difference between this and the original is I removed the parens.
For what it's worth, I'm pretty sure that when you remove the parens, you have to change the '+' to a '-':
COMPUTE ADJ-MEMO-CREDITS ROUNDED =
ADJ-MEMO-CREDITS - RSRV-ACC-INT - .005.
Louis
.
- Follow-Ups:
- Re: rounding
- From: Doug Miller
- Re: rounding
- References:
- rounding
- From: Frank Swarbrick
- rounding
- Prev by Date: Re: How proprietary is the "COBOL file system"
- Next by Date: Re: How proprietary is the "COBOL file system"
- Previous by thread: Re: rounding
- Next by thread: Re: rounding
- Index(es):