Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

BCP Unexpected EOF encountered in BCP data-file

2 posts in Windows NT Last posting was on 1999-12-18 04:58:33.0Z
Laura Yen Posted on 1999-12-17 15:29:16.0Z
Message-ID: <385A56CC.150C8DB5@us.ibm.com>
Date: Fri, 17 Dec 1999 10:29:16 -0500
From: Laura Yen <lyen@us.ibm.com>
X-Mailer: Mozilla 4.5 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: BCP Unexpected EOF encountered in BCP data-file
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 18
NNTP-Posting-Host: ss06.nc.us.ibm.com 32.97.136.236
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:2808
Article PK: 1090245

I exported a DB2 table into a file with delimeter of ',' and String of "
(double quote).
I then replaced all double quotes ("") with null - since Sybase doesn't
seem need double quotes for Strings.
When import the data file into Sybase using bcp with the following
command,
bcp Test1..Employee in emp.del -c -t , -r \n -e error.txt

I got 2 problems:
1.Unexpected EOF encountered in BCP data-file.
bcp copy in partially failed.

It imported all rows but the last row. How should I fix the EOF
problem ?

2.I did not find the error file (error.txt). Where did the file go ?

BTW I am running ASE 11.5.1 on NT 4.0 Server SP4.

Thanks for your help.

Laura Yen


Mark A. Parsons Posted on 1999-12-18 04:58:33.0Z
Message-ID: <385B1479.B1229E5F@compuserve.com>
Date: Sat, 18 Dec 1999 17:58:33 +1300
From: "Mark A. Parsons" <iron_horse@compuserve.com>
Organization: Iron Horse, Inc.
X-Mailer: Mozilla 4.61 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: BCP Unexpected EOF encountered in BCP data-file
References: <385A56CC.150C8DB5@us.ibm.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 43
NNTP-Posting-Host: p311.ipa1-n8-16.iconz.net.nz 210.48.25.55
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:2803
Article PK: 1090244


Laura Yen wrote:
>
> I exported a DB2 table into a file with delimeter of ',' and String of "
> (double quote).
> I then replaced all double quotes ("") with null - since Sybase doesn't
> seem need double quotes for Strings.
> When import the data file into Sybase using bcp with the following
> command,
> bcp Test1..Employee in emp.del -c -t , -r \n -e error.txt
>
> I got 2 problems:
> 1.Unexpected EOF encountered in BCP data-file.
> bcp copy in partially failed.
>
> It imported all rows but the last row. How should I fix the EOF
> problem ?

What are you using as the end-of-record (row?) terminator? Is that
terminator present at the end of your last data row?

Have you verified that the rows successfully inserted have the correct
value in *all* of their columns?

Could the last row in your data file be missing a data column? Maybe
have a ',' as part of data which could be throwing off bcp? Maybe have
an extra quote embedded somewhere in the data?

>
> 2.I did not find the error file (error.txt). Where did the file go ?

I've found that the '-e' option typically catches information about data
type errors, rule/integrity issues, etc ... typically errors coming back
from the dataserver having to do with data-specific issues. The '-e'
doesn't capture what you could call 'system' errors having to do with
bcp, e.g., problems reading a data file (i.e., it's not even getting to
the dataserver so it's not considered a 'data' error and thus it doesn't
make it into the '-e' target file.)

And if there are no errors for the '-e' target file ... the file does
not get created.


--
Mark Parsons
Iron Horse Consulting, Ltd.