I have source like below with Varchar(19)
-000000000001289000
+000000123456789000
I am using StrinToDecimal(Input) and giving data type as Decimal(18,4)
But in dataset it showing for first field is as
-00000000000128.9000
for second field it showing all zeros
00000000000000.0000
and also I am getting warning
APT_CombinedOperatorController,1: Conversion error calling conversion routine decimal_from_ustring data may have been lost
Please help me on this what I am doing wrong here
how to convert into decimal format
Moderators: chulett, rschirm, roy
Re: how to convert into decimal format
It seems few guys are fishing for the same question. Read the below link which i copied from the other thread. Try to understand. Come back with your understanding as well as what you have tried!
http://pic.dhe.ibm.com/infocenter/iisin ... tions.html
http://pic.dhe.ibm.com/infocenter/iisin ... tions.html
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
I had already refered the document and also searched in dsxhange but not getting the correct answers.
I am applying the function like below
StringToDecimal(Inputcolumn/10000)
As I mentioned in my earlier post that for the value -000000000001289000
I am getting correct output that -128.9000
but for the value +001234567811289000 I am getting
0000000000000.0000
I am not understanding why first value is giving correct output na dwhy not for second value.
I am applying the function like below
StringToDecimal(Inputcolumn/10000)
As I mentioned in my earlier post that for the value -000000000001289000
I am getting correct output that -128.9000
but for the value +001234567811289000 I am getting
0000000000000.0000
I am not understanding why first value is giving correct output na dwhy not for second value.
still problem is there.
I tried with (StringToDecimal(Input)/10000). My output is coming as expected but still I am getting warning
"Conversion error calling conversion routine decimal_from_ustring data may have been lost"
Any idea why I am getting this warning how to remove it without message handler.
I tried with (StringToDecimal(Input)/10000). My output is coming as expected but still I am getting warning
"Conversion error calling conversion routine decimal_from_ustring data may have been lost"
Any idea why I am getting this warning how to remove it without message handler.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I'm slightly intrigued as to why there is a reference to decimal_from_ustring in there for a varchar - are you using extended metadata options? I wouldn't be surprised also if, under the covers, your transformation is going from a varchar to another datatype in an intermediate variable, before being output to the selected decimal form. It might be this is causing some interference here. I've tried in vain to find a reporting variable that would output this in the log, but could not. The only place I have seen it visible is when exporting the job design as a dsx and then it was visible under the transform operator, similar to
You could also find it in the .trx file under the project too.
In this instance we have some odd behaviour with our output too, which I'm currently working through with the vendor. The above comes from an AsInteger(StringToDecimal)) function combination.
Code: Select all
// declare our intermediate variables for this section
dfloat InterVar0_1;
int64 InterVar0_2;
In this instance we have some odd behaviour with our output too, which I'm currently working through with the vendor. The above comes from an AsInteger(StringToDecimal)) function combination.
Last edited by miwinter on Fri Jun 21, 2013 1:44 am, edited 1 time in total.
Mark Winter
<i>Nothing appeases a troubled mind more than <b>good</b> music</i>
<i>Nothing appeases a troubled mind more than <b>good</b> music</i>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Most of the type conversion functions in the Transformer stage are actually implemented as modify operators under the covers. Thus, for example, StringToDecimal() function in Transformer stage is actually implemented as the decimal_from_string() or decimal_from_ustring() function in Orchestrate depending on whether or not NLS is enabled.
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.