Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error upload text file to AS400 via Client Access ODBC

Status
Not open for further replies.

bearfish

Programmer
Nov 10, 2003
28
MY
Hi, I'm a newbie and using DTS Import/Export Wizard to upload a text file to AS400. My text file is a Fixed field. So I've selected File Type: ANSI, Row Delimiter: {LF}, then insert vertical line on the text to specify the starting and ending position for each column.
I've configured my DNS as Client Access ODBC Driver and able to select the Destination table from the list AS400 tables.
The problem is when I click on Preview it return this error:

Error Source: Microsoft Data Transformation Services Flat File Rowset Provider
Error Description: Invalid Column Length.
Context: Error calling OpenRowset on the provider.

I've check each column length where i set the starting and ending position for each colum, the length is correct. What did I miss out here?
Thank you.
 
Check first one thing. You should not make the vertical line after the last column, end-of-line is supposed to handle it. BTW, are you sure rowdelim is LF ?

Cheers


[blue]Backup system is as good as the latest recovery[/blue]
 
Yeah. I've check that I did not make an extra vertical line at the last column. Its already set with red vertical line at the last column by default. I'm not very sure the row delimiter is LF, but on my text file, there is no delimiter.
The text file is generated by a C program, where, it use '\n' to insert the next record on next row.
 
Are you sure there's no ugly lines meaning shorter ones ? How about the last line ?

Cheers


[blue]Backup system is as good as the latest recovery[/blue]
 
I did not see any shorter line in any of the rows. There is an extra line after the last row of record. Even after I manually remove the extra newline after the last row, it still return the same error. Do I need specific config to upload data to AS400?
 
Hi, I found out there is missing spaces at the end of line. Thank you for your suggestion to check the line for shorter one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top