DB2 to Flat File Conversion Error
I am new to SSIS. I am using BIDS 2008. I have created a package that exports DB2 data (OLE DB Source) to a flat file destination. I am receiving the error message below when executing the package. It appears to be stopping
on a character field that begins with "<"
I was thinking I should redirect any records with errors out to a flat file or some other destination but since I am trying to write to a text file and that is causing the error I get the same error when I try to redirect to a different flat file.
Does anyone know how I can/should handle this situation?
Thanks,
Matt
[Master Records File [1145]] Error: Data conversion failed. The data conversion for column "REGLINE3" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
May 9th, 2011 11:58am
Can you provide a little more of the error report? It would help to know which part of the package was reporting the error - the DB2 source, a transform in the middle, or the flat file destination.
In general, the error you're receiving indicates that a column from your DB2 table is either too wide to fit in the space you've allocated for it in the flat file, OR the character set you're reading from the DB2 table can't be mapped to the character set
you've specified for the flat file.
Talk to me now on
Free Windows Admin Tool Kit Click here and download it now
May 9th, 2011 1:04pm
Thanks for the reply. Sorry for not providing enough information I have included additional information from the report below.
The default code page for the DB2 source is set to 1252 if that makes any difference.
I'm not sure where I set the character set on either the source or the destination. If you can tell me where to find it I will include it here.
Thanks again
Matt
[SSIS.Pipeline] Information: Execute phase is beginning.
[Master Records File [1145]] Error: Data conversion failed. The data conversion for column "REGLINE3" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
[Master Records File [1145]] Error: Cannot copy or convert flat file data for column "REGLINE3".
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Master Records File" (1145) failed with error code 0xC02020A0 while processing input "Flat File Destination Input" (1146). The identified component
returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure.
[PS [1]] Error: The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020.
[SSIS.Pipeline] Information: Post Execute phase is beginning.
May 9th, 2011 2:02pm
Since you are outputting to a flat file revise your metadata for the correct length (increase) and possibly amend the data type (why not to make all the flat file fields text?).
Additionally you can use a
Data Viewer to see what and how the data looks like once picked by the source.Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
May 9th, 2011 2:29pm
According to the table layout the length is correct. 300,000 records are written to the file before it encounters the record with "<" as the leading character.
I will look into your other suggestions. Thank you.
May 9th, 2011 2:37pm
I let the BIDS wizard pick the data type for the metadata. It is listed as DT_WSTR in the Data Flow Path Editor but it is uneditable. I'm not sure where to change it.
Free Windows Admin Tool Kit Click here and download it now
May 9th, 2011 2:45pm
It is probably hitting a character that has no ASCII direct equivalent so you may need to
redirect your erroneous rows indeed.Arthur My Blog
May 9th, 2011 2:47pm
I looked at the record in DB2 using IBM's command editor. It appears as an unreadable block. When I used the ASCII function to convert the character it came back with 155 which I believe is "<".
I figured out where to change the data type. I will experiment with that.
Thanks again.
Free Windows Admin Tool Kit Click here and download it now
May 9th, 2011 3:24pm