decimal_from_string warning for same data length
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 104
- Joined: Thu Jul 12, 2007 11:32 pm
- Location: Canada
decimal_from_string warning for same data length
I am converting a Varchar to Decimal and it is throwing the below error:
Conversion error calling conversion routine decimal_from_string data may have been lost
Source Datatype: Varchar 10
Target Datatype: Decimal (10,0)
I am using an existing Dataset (In Production) which has a datatype of Varchar(10) as source and writing into Netezza database.
I tried increasing the length of the Varchar fields in a transformer to Varchar 12 and then write into the Decimal(10,0) but i still get the same warnings
I want to get rid of the warnings without using the Message handler
can you please suggest ?
Thanks,
Aditya
Conversion error calling conversion routine decimal_from_string data may have been lost
Source Datatype: Varchar 10
Target Datatype: Decimal (10,0)
I am using an existing Dataset (In Production) which has a datatype of Varchar(10) as source and writing into Netezza database.
I tried increasing the length of the Varchar fields in a transformer to Varchar 12 and then write into the Decimal(10,0) but i still get the same warnings
I want to get rid of the warnings without using the Message handler
can you please suggest ?
Thanks,
Aditya
Thanks
Aditya Kutcharlapati
Aditya Kutcharlapati
You can also use the Modify stage to do the conversion operation and use the NOWARN specification since the string to decimal conversion seems to be handled by DataStage :
https://www-01.ibm.com/support/knowledg ... sions.html
Ex :
https://www-01.ibm.com/support/knowledg ... sions.html
Ex :
Code: Select all
DEC01:decimal[10,0] = STR01
BI Consultant
DSXConsult
DSXConsult
-
- Premium Member
- Posts: 104
- Joined: Thu Jul 12, 2007 11:32 pm
- Location: Canada
Mike,
Thank you for the reply.
I am using the below conversion function in the transformer stage
Thomas,
Thank you, i will use the modify stage and let you know
Thanks,
Aditya
Thank you for the reply.
I am using the below conversion function in the transformer stage
Code: Select all
StringToDecimal(trim(fromLkp.master_cust_number))
Thank you, i will use the modify stage and let you know
Thanks,
Aditya
Thanks
Aditya Kutcharlapati
Aditya Kutcharlapati
-
- Premium Member
- Posts: 104
- Joined: Thu Jul 12, 2007 11:32 pm
- Location: Canada
Thank you Thomas .. it worked
I used the below specifications in Modify stage and the job completed successfully without warnings
I used the below specifications in Modify stage and the job completed successfully without warnings
Code: Select all
Specification = cust_num:decimal[10,0] = decimal_from_string(cust_num)
Specification = NOWARN
Last edited by adityavarma on Mon Nov 23, 2015 2:26 pm, edited 9 times in total.
Thanks
Aditya Kutcharlapati
Aditya Kutcharlapati
-
- Premium Member
- Posts: 104
- Joined: Thu Jul 12, 2007 11:32 pm
- Location: Canada
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I had the thought that maybe they (IBM) could put something like NOWARN into the properties of the Transformer stage, but my second, better, thought was that that would lead to too much lazy programming.
Last edited by ray.wurlod on Wed Nov 25, 2015 2:57 pm, edited 1 time in total.
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.
StringToDecimal is an explicit type conversion function for the transformer stage, so it won't generate a warning in going from varchar(10) to decimal(10,0) if your source string is nothing but numeric digits.
Did you isolate a specific example row that causes a warning?
Using NOWARN is likely masking a source data quality issue.
Your transformer expression with a simple Trim function isn't adequate to handle bad source data.
Mike
Did you isolate a specific example row that causes a warning?
Using NOWARN is likely masking a source data quality issue.
Your transformer expression with a simple Trim function isn't adequate to handle bad source data.
Mike