Rounding Issue

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
velagapudi_k
Premium Member
Premium Member
Posts: 142
Joined: Mon Jun 27, 2005 5:31 pm
Location: Atlanta GA

Rounding Issue

Post 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.
Venkat Velagapudi
Thomas.B
Participant
Posts: 63
Joined: Thu Apr 09, 2015 6:40 am
Location: France - Nantes

Post 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
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post 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
velagapudi_k
Premium Member
Premium Member
Posts: 142
Joined: Mon Jun 27, 2005 5:31 pm
Location: Atlanta GA

Post by velagapudi_k »

Thanks for the responses guys. DecimalToDecimal Worked.
Venkat Velagapudi
Post Reply