Not able to get correct data

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
ambasta
Participant
Posts: 93
Joined: Thu Jan 19, 2006 10:29 pm
Location: Bangalore

Not able to get correct data

Post by ambasta »

Hi All,
I have two jobs.First job is Oracle to Dataset and 2nd is from that dataset to sequential fixed width file.In oracle field is having datatype numeric(15,2) and data is 5.2 I am writing this to dataset and converting it to numeric(7,2)in dataset i am able to see data as 00005.20.in next job my requirement is to populate this data as 0000520 which is char in target file.i am multiplying this by 100 but data is coming as [ 000000]{six zero followed by one blank space}.how to do that???can anyone please help me??

Thanks in advance
ambasta
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Make your Char field wider than 7. The conversion function from decimal to string requires a space for the sign character. Or you could trim the result of that conversion.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ambasta
Participant
Posts: 93
Joined: Thu Jan 19, 2006 10:29 pm
Location: Bangalore

Post by ambasta »

Hi Ray,
when i am multiplying that data with 100 it is returning me zero.
Now what i have done is ...defined target column as char(7,2).then data is coming like[ 00005.20]{data followed by blank space}.first i am taking substring[2,5] and then concating with substring[8,2].it is giving me the desired results for now.is it the right???please suggest me.
ambasta
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What do you mean by Char(7,2)? Try Char(8) or VarChar(8)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ambasta
Participant
Posts: 93
Joined: Thu Jan 19, 2006 10:29 pm
Location: Bangalore

Post by ambasta »

Thanks Ray,
Itried using this using cahr(8) this is taking balank spaces but when i tried with char(7)it is also giving me the desired result.


Thanks.
ambasta
Post Reply