Conversion error

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
nveejas
Participant
Posts: 11
Joined: Sun Sep 26, 2010 11:42 pm
Location: illinois

Conversion error

Post by nveejas »

My source is a fixed width file. In that i have a field with value as 000012345.00 in source. In the target it is decimal. so when i try to convert it to decimal with stringToDecimal function i'm getting the following warning and also in target the value is convrted as 000000.00,

APT_CombinedOperatorController,0:Conversion error calling conversion routine decimal_from_string data may have been lost

Please give me some suggestions inorder to get correct value in the output without any warnings.
Note: Source daatype- char(12)
Target datatype - decimal(9,2)
Thanks,
Sajeev N
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: Conversion error

Post by SURA »

Hence the source is char it may have space. Change the data type as VC as well as use ' ','A' in the TRIM function.
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

But i believe, there may not be any space, since his data is exactly 12 character long 000012345.00
pandeeswaran
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Given your data types this is a spurious error ("they" are being over-cautious). Use a message handler to demote it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nveejas
Participant
Posts: 11
Joined: Sun Sep 26, 2010 11:42 pm
Location: illinois

Post by nveejas »

Hi Ray,

I can demote it but the value populated in targer is not correct. It is converted to 0000000.00 (total 9 zeros) and also as pandeesh said the lenght is exactly 12 charactes.
Thanks,
Sajeev N
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

You're losing data because 000012345.00 would require decimal(11,2) rather than 9,2.
Choose a job you love, and you will never have to work a day in your life. - Confucius
nveejas
Participant
Posts: 11
Joined: Sun Sep 26, 2010 11:42 pm
Location: illinois

Post by nveejas »

Hi Eric,

you are right..
Issue is solved..
Thanks,
Sajeev N
Post Reply