SSIS Flat File Import Error

  • Hello,

    I am having an issue importing a flat file into an SSIS package. The file I am importing has a footer and header that have fewer fields than the rest of the file, I set flat file connection to skip the header row. The file is usually pretty small, just a few records, and it usually runs just fine, but the file that came in the other day was a bit bigger, 17 records or so, and it ended up failing.

    I am using SQL Server 2005, and Visual Studio 2005.

    Here are the errors messages I get:

    [ACT_RLP input file [116792]] Warning: There is a partial row at the end of the file.

    SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "ACT_RLP input file" (116792) returned error code 0x80040E21. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.

    Error Code DTS_E_THREADFAILED. Thread "SourceThread0" has exited with error code 0xC0047038. There may be error messages posted before this with more information on why the thread has exited.

    SSIS Error Code DTS_E_THREADCANCELLED. Thread "WorkThread0" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown. There may be error messages posted before this with more information on why the thread was cancelled.

    SSIS Error Code DTS_E_THREADFAILED. Thread "WorkThread0" has exited with error code 0xC0047039. There may be error messages posted before this with more information on why the thread has exited.

    SSIS Error Code DTS_E_THREADFAILED. Thread "WorkThread0" has exited with error code 0xC0047039. There may be error messages posted before this with more information on why the thread has exited.

    None of that really means much to me, but I believe the problem is with the footer.

    Here is what the footer looks like: "+|9|9999999|16|9|20130906|LOAD-DELTA : ALP |LGNT |1|21|0|17|2"

    It's pipe delimeted, I have found that the file will run successfully if I change the file like:

    1. remove the footer.

    2. add a pipe to the end of the footer.

    3. add an empty footer line to the end of the file like "+|||||||||||||"

    I have also found the file will load successfully if I change the 12th field, the "17" to a single digit, 0 - 9, so finding that out I looked into the flat file connection manager, and the 12th field, which was a status_code had a OutputColumnWidth of 1, I changed it to 2 and the file ran successfully.

    So, I am just wondering if anyone has any suggestions how to solve this problem without changing the field length of one of my fields, or manipulating the actual file.

    Thanks

  • Unfortunately for you, the flat file source expects all records in the file to have the same structure. So, if you have a different number of fields in your trailer, you have a problem.

    One possible solution is to split up the file into separate files based on the type of data in each record - use the flat file import but treat each record as a single field and do a conditional split based on the record type. Write the output from each output from the conditional split to a separate file. Now you can import each of the resultant files using separate connection managers which are configured to have the correct number of columns for each of the records.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply