Glenn, thanks for the help. That cured the problem! I assumed that the
compiler would strip off the commas and period and then convert it to an
integer. Goes to show what happens when you assume.
[log in to unmask] wrote:
> Paul Edwards writes:
>
> > Has anyone experienced this problem/bug? Version: COBOL HP31500A.04.14.
> > When using the FUNCTION NUMVAL-C on a field - X(12) - that has "158.20"
> > in it, the output field - S9(06)V99 - is "15819". Most of the other
> > records pass OK with no changes. About 27 records out of about 700 get
> > changed this same way by rounding down .01. None of the values are the
> > same.
>
> I assume this is a result of the imprecision of representing 158.20
> as a floating-point value.
>
> I verified (at least with this specific example) that you can get
> the desired result using ROUNDED, e.g.,
>
> COMPUTE PW-NUM ROUNDED = FUNCTION NUMVAL-C( PW-CHAR ).
>
> --Glenn Cole
> Software al dente, Inc.
> [log in to unmask]
>
> .......................................................................
>
> Item Subject: cc:Mail Text
--
*****************************************************************
* Paul Edwards HP 3000 Certified Consultant *
* Paul Edwards & Associates 1506 Estates Way *
* Email: [log in to unmask] Carrollton TX 75006 *
* Phone: (972) 242-6660 Fax: (972) 446-9022 *
*****************************************************************