I am mapping floats sourced from SQL Enterprise to target of Numeric(25,7).
The size of the target almost guarantees that I will have some visible difference in the actual values, especially since I have no specifications for truncation or rounding.
My average mapping from float to such a target results in a difference of 0.001.
The worst difference in actual magnitude between source and target is
Source:
3178248133570.72
Target:
3178248011776.0000000
With a difference of:
121794.720214844
I realize this is accurate to 7 digits, and I might be asking for a little much to get something better. I've tried several things to reduce the issue:
1) Change source metadata from float to double. This is something that DataStage seems to do automatically with a warning:
2) Using an explicit conversion function from float (15) to numeric (25,7):Input: When checking operator: When binding output interface field "FIELD_NAME" to field "FIELD_NAME": Implicit conversion; from source type "dfloat" to result type "sfloat": Possible range/precision limitation
DfloatToDecimal(LookupResults.FIELD_NAME, "round_inf")
Both of these changes resulted in the same results as relying on implicit conversion to target.
From reading some of the posts here, it seems that this is fairly typical for such conversions, although I am pressed to ask if anybody has any other suggestions for improving the result (other than making the target a float as well). My Business users are not going to be impressed with the above example.
Also, is DfloatToDecimal(LookupResults.FIELD_NAME, "round_inf") the preferred conversion method and in which situations will it outperform the implicit conversion?
Your input is appreciated.
Thanks,
Greg