on 06-15-2015 1:15 PM
I am getting the following warning message for date fields
Cannot convert string <0> to date using format string <yyyymmdd>.
Cannot convert string < > to date using format string <yyyymmdd>.
Cannot convert string < 00> to date using format string <yyyymmdd>.
The system has been around for a while and the source data quality is poor.
There are around 81 dataflows in a job and many columns use to_date function for conversion. ( all data flows are direct mapping with only date conversion)
Some Data Flows has million records.
The source and target are Oracle / SQL Server and use ODBC connection.
Regards,
Divya
I think ifthenelse needs slight tweak
ifthenelse(field in ('','0'),NULL,to_Date(field,'yyyymmdd'))
Also try exploring is_valid_date() function
A useful note on this scenario is available here
Error Handling - Enterprise Information Management - SCN Wiki
These types of warning definitely affect the performance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are correct Magesh!!
I have tweaked the to_date function as below
Divya,
You can use the below date validation to avoid the date conversion warnings
ifthenelse( is_valid_date(DATE, 'yyyymmdd') = 1,
ifthenelse(year(to_date(DATE, 'yyyymmdd')) >= 1900,
to_date(DATE, 'yyyymmdd'),
NULL),
NULL)
Please note that SQL Server doesnt processes dates older than 1900.
Regards
Arun Sasi
Thanks Arun , Magesh for the reply.
Even I found only file format has the option to ignore conversion warnings.
Cannot change it in the source as data is coming from different application Tables.
Applying this function for all the fields is going to be a big activity since lots of dataflows are involved.
May be that is the only option I am left with now.
Regards,
Divya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Divya,
The warnings will appear if the string data which you are converting to date format contains space or characters which cannot be converted by Data services.
You need to make sure that these formats are not present in the source table/files. You need to consolidate the data in Source itself such that these warnings are not displayed.
There is only one way to avoid these warnings but only when you have your Source as a flat file. This comes under the error handling part in the file format.
You can set the Log Data conversion warnings to NO and set the maximum warnings to a specific number.
Regards
Arun Sasi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.