issues in data transformation decimal to integer

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
madhav62
Premium Member
Premium Member
Posts: 15
Joined: Sun Aug 15, 2010 9:26 pm

issues in data transformation decimal to integer

Post by madhav62 »

Hi,
I am doing transformation on decimal value to feed into flatfile
incoming data has field which is decimal(with two decimal places) i need to convert it into integer in COBOL format 9(6)v9(3)
i am using derivation right("0000000000":(column.value*1000),9)
it works fine with some value expect for value like 456783.235
the value it show as 56783e+8 but i am expecting the value
456783235.
can any tel me what want wrong?
divesh
Participant
Posts: 7
Joined: Wed Dec 20, 2006 5:18 pm

Re: issues in data transformation decimal to integer

Post by divesh »

Looks like your target field datatype is double/dfloat after the transformation.
Can you try making it Integer 10
madhav62
Premium Member
Premium Member
Posts: 15
Joined: Sun Aug 15, 2010 9:26 pm

Re: issues in data transformation decimal to integer

Post by madhav62 »

divesh wrote:Looks like your target field datatype is double/dfloat after the transformation.
Can you try making it Integer 10
Its actually varchar(9)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

VarChar(9) is not big enough - you need at least VarChar(11) - you have nine significant digits, a sign and a decimal placeholder. Where do you expect the third decimal place to come from, given that your source column only has two?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
madhav62
Premium Member
Premium Member
Posts: 15
Joined: Sun Aug 15, 2010 9:26 pm

Post by madhav62 »

ray.wurlod wrote:VarChar(9) is not big enough - you need at least VarChar(11) - you have nine significant digits, a sign and a decimal placeholder. Where do you expect the third decimal place to come from, given that your source column only has two?
Source column has three decimal places. is there any other way to declare the value.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: issues in data transformation decimal to integer

Post by ray.wurlod »

madhav62 wrote:incoming data has field which is decimal(with two decimal places)
Sorry, I was tricked by this statement in your original post.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply