Rounding problems

Boris Kortiak BKortiak@genlyte.com
Wed, 13 Dec 2000 16:03:23 -0500


I'm using Quiz on an HP e3000 MPE/ix 6.0 and I'm having a problem with formatting some data.

I am using the following defines:
======
 DEFINE D-C-SLSMN-BOOK-COST     NUM*10                  =    &
         ROUND((D-SLSMN-BOOK-COST*100), 1, NEAR)
 DEFINE D-C-SLSMN-BK-CST-I      CHA*10                  =    &
         RJ(TRUNCATE(ASCII(D-C-SLSMN-BOOK-COST,10)))
 DEFINE D-C-SLSMN-BK-CST        CHA*11                  =    &
         LJ(D-C-SLSMN-BK-CST-I[1:8]             +            &
            "."                                 +            &
            D-C-SLSMN-BK-CST-I[9:2])
======

Through a show items, I see that the origin data item is defined thus:
======
                                             INPUT OUTPUT
BKG31MSE                                TYPE SCALE SCALE  DEC PICTURE
  D-SLSMN-BOOK-COST                     NUM     0     2    0  ^,^^^,^^^.^^
======

My report output contains the following:
======
006   THORNE                          -0002240.00          -137829          -000137828      -0001378.28       -861.71     38.5
           .00       -861.71     38.5
======

You will note that the second numeric column is properly rounded and ends in a '9'.  The formatted versions of this number end in an '8'.

What am I overlooking?

-- 
The opinions expressed are my own, especially if I'm right.
COBOL the choice of a GNU generation http://www.gnu.org/software/cobol/index.html 
Make money while you surf the web http://users.erols.com/bpkprsnl/GetPaid.html
See my web page at http://users.erols.com/bpkprsnl/


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.