Page 1 of 1

Rounding Issue

Posted: Tue Jul 07, 2015 7:53 am
by velagapudi_k
Hello all, my input is decimal 4,2 and my output is smallint. So I am using Ceil func to get the closest value.

What I am expecting is

Ceil (7.04) =7

ceil(7.94)=8

But in both cases above, the output I am getting is 8. Let me know if there is another way around.

Posted: Tue Jul 07, 2015 8:15 am
by Thomas.B
DataStage will adapt the input data to the output format, so, from a decimal to a smallint field just mapping your field will do the required conversion

Posted: Tue Jul 07, 2015 8:41 am
by Mike
Review the documentation for the Ceil function. It is not a rounding function.

You could try out the DecimalToDecimal function with the round_inf argument.

Mike

Posted: Tue Jul 07, 2015 10:54 am
by velagapudi_k
Thanks for the responses guys. DecimalToDecimal Worked.