Data Conversion Errors
Pickering, John (NORBORD)
PICKERIJ@norbord.com
Tue, 20 Nov 2001 11:54:16 -0500
George
No real answers. Just a couple of comments.
Are you sure these data conversion errors are happening in the code in your
example below? If the items involved are all already numeric then, strictly
speaking, there is no "conversion". Goofy values might cause calculation
errors but not conversion errors. Does the rest of your code have any code
which converts to numeric? How about date based selection or calculation?
Goofy dates have caused me more grief than arithmetic. Usually PH is pretty
forgiving about calculation errors, simply returning zero and pressing on
regardless, so your divide by zero (using percent where revenue-amt is zero)
rows shouldn't cause the reported errors. But then I've never used PH on an
AS/400 and I skipped all versions of PH6 on purpose.
The other comment I'd make relates to your comment about "#" symbols. These
should have nothing to do with calculation or conversion errors. They simply
mean that the result cannot be displayed in the picture that you have
provided, either because the result is too big or you didn't allow for a
sign. The lack of "#####" in your output has nothing to do with the reported
errors.
Regards,
JWP
> -----Original Message-----
> From: george.j.wen@us.abb.com [SMTP:george.j.wen@us.abb.com]
> Sent: Monday, November 19, 2001 12:43 PM
> To: powerh-l@lists.swau.edu
> Subject: Data Conversion Errors
>
>
>
> I'm on PH 6.07F (AS/400) but this question may be gereric enough.
> I'm processing Revenue/Cost lines with a Margin Percent in Quiz.
> Calcs and defines are pretty std. Vis:
> def REVENUE-AMT float*8 = GLAA * -1
> def MARGIN-AMT float*8 = REVENUE-AMT - SDECST
> *************************************************************************
> Footing........................
> tab 77 REVENUE-AMT Subtotal trailing "-" pic '¬¬¬,¬¬¬,¬¬¬.¬¬ ' &
> tab 94 SDECST Subtotal trailing "-" pic '¬¬¬,¬¬¬,¬¬¬.¬¬ '
> &
>
> tab 109 MARGIN-AMT Subtotal trailing "-" pic '¬¬¬,¬¬¬,¬¬¬.¬¬ ' &
> tab 124 MARGIN-AMT Percent REVENUE-AMT trailing "-" pic '¬¬¬¬.¬¬¬ '
>
> I don't get any errors on the report but the statistic cite them:
> records selected : 100
> ** Data conversion errors: 220666
> *************************************************************************
> Revenue Amt Cost Amt Margin Amt Percent
> 34.88 270.00 235.12- 674.083-
> 927.75 7,237.11 6,309.36- 680.071-
> 390.68 3,224.88 2,834.20- 725.453-
> 971.14 8,559.20 7,588.06- 781.356-
> 163.89 1,897.75 1,733.86- 1057.941-
> .00 1,560.00 1,560.00-
> .000
> 1,934.97 1,357.24 577.73 29.857
> 580.20 337.58 242.62 41.817
> 1,852.05 1,189.65 662.40 35.766
> This sample contains some of the more unusual lines (warr) in the report
> but there are no # signs to indicate data conversion errors and if I
> select to
> avoid getting negative Margin Amt's there's no difference in the result.
>
> Anyone have an idea of where to look?
>
> Thank you in advance
> George
>