Does what you're doing work? The only improvement I could suggest would be to use stage variables for clarity and to avoid multiple calculations of the same function. Maybe use Left() function to test for the sign, if the input column data type is string.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod wrote:Does what you're doing work? The only improvement I could suggest would be to use stage variables for clarity and to avoid multiple calculations of the same function. Maybe use Left() function to test for the sign, if the input column data type is string.
The problem with the above is it will take values to the right of decimal (precision) which i dont want.
Sainath.Srinivasan wrote:Abs will return integer value. So you will loose the decimals.
Technically, it returns a dfloat - but the input is an integer, so your trailing decimals get stripped off before they are passed to ABS. How's that for nitpicking? But, I see you want to strip the trailing decimals anyway, so ABS is ok.
Try this:
Sainath.Srinivasan wrote:Abs will return integer value. So you will loose the decimals.
Technically, it returns a dfloat - but the input is an integer, so your trailing decimals get stripped off before they are passed to ABS. How's that for nitpicking? But, I see you want to strip the trailing decimals anyway, so ABS is ok.
Try this:
That's in the Server Job Developer's Guide, but you've specified that this is in relation to a Parallel Job. Abs() in a Parallel Job converts its input to an Integer. Fabs() works with floating point values in parallel jobs.
Or, are you using a BASIC Transformer? I don't know if they behave like Server in this regard.
That's in the Server Job Developer's Guide, but you've specified that this is in relation to a Parallel Job. Abs() in a Parallel Job converts its input to an Integer. Fabs() works with floating point values in parallel jobs.
Or, are you using a BASIC Transformer? I don't know if they behave like Server in this regard.
Thanks, I verified abs function is removing precision for decimals.