Dazed and Confused

Mike Palandri palandri@4j.lane.edu
Thu, 22 Jul 1999 08:21:27 -0700


Hi Jeff,

I hesitate to mention this because to do it right would require a change
in the the permanent file, which is probably more than you want to
tackle. (It'd be more than I'd want to tackle to cure this problem.)  

However... Unless the quantity needs to be measured down to a very small
fraction, I would change the type of the FOE-QTY-ORDERED item to an
integer of appropriate size.  

Integers can be used to store decimal values using appropriate scaling
factors, and are not subject to the approximation and rounding errors
associated with floats.  They also compare exactly and are predictable
size-wise.

As a quick and dirty fix, you may want to try casting the FLOAT to an INT
via a define, and storing the defined item in the subfile rather than the
original FLOAT element:

DEF DI-FOE-QTY-ORDERED 	INT*12 = FOE-QTY-ORDERED

then use the same size INT when appending to the subfile:

DEF FOE-ORD-QTY   INT*12  = 0




Mike