hi,
i have two sequence of jobs, one writing data from seq file to dataset and other is to load the data from the dataset(o/p from the first job) into an oracle table.
input:-seq file, 5 columns. for "qty" column, datatype of varchar, no fixed length and nullable. it has values like 30,4,120,1340, ...
i am trying to do a transform from varchar, no lenght and nullable TO decimal, length 5 scale 3 and nullable.
i tried stringToDecimal, but i am getting the o/p as below
inp
qty
4
30
130
60
1450
o/p
04.000
30.000
00.000
60.000
00.000
and i am getting the following warning.
Conversion error calling conversion routine decimal_from_string data may have been lost.
all i need is to get the same numbers as in the input but i need them in number format.
can anyone help me out.
thanks
problem with string to decimal conversion
Moderators: chulett, rschirm, roy
Re: problem with string to decimal conversion
Conversion error calling conversion routine decimal_from_string data may have been lost.
Try "trim" and then convert.
StringToDecimal(Trim(XXX))
~Kris
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
DataStage's data browser (View Data) always displays decimal numbers with leading and trailing zeroes, so that you can check that the precision and scale are being handled correctly.
Neither 130 nor 1460 can be represented as decimal[5,3] because that data type allows for not more than two digits to the left of the decimal place. This is what has caused the messages to be generated. To represent 1460 as a decimal number with three decimal places you need at least decimal[7,3].
Neither 130 nor 1460 can be represented as decimal[5,3] because that data type allows for not more than two digits to the left of the decimal place. This is what has caused the messages to be generated. To represent 1460 as a decimal number with three decimal places you need at least decimal[7,3].
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Re: problem with string to decimal conversion
in transform set to input.field/1, convert null to '0' , set the output datatype to Decimal(5,3).
It will work
It will work
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: