Page 1 of 1

Not able to get correct data

Posted: Wed Oct 11, 2006 12:12 pm
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

Posted: Wed Oct 11, 2006 2:45 pm
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.

Posted: Wed Oct 11, 2006 3:04 pm
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.

Posted: Wed Oct 11, 2006 3:16 pm
by ray.wurlod
What do you mean by Char(7,2)? Try Char(8) or VarChar(8)

Posted: Wed Oct 11, 2006 3:34 pm
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.