fastload script insert phase error.

Tools
Highlighted
Enthusiast

fastload script insert phase error.

Hi all teradata gurus,

This fastload example gives an error in the as shown below, any ideas how to correct it,

**** 15:35:51 Number of recs/msg: 414
**** 15:35:51 Starting to send to RDBMS with record 1
**** 15:35:51 I/O Error on File Read: 35, Text: EOF encountered before
end of record

Name of records file is with data as shown below,

|10021 |Brown, Jo |200|2312|Development |63000.00 |20|Jan 01 1955|F| |M|16| 0|
|10001 |Jones, Bill |100|5376|President |83000.00 |15|Jan 01 1960|M| |M|14| 0|
|10002 |Smith, Jim |100|4912|Sales |73000.00 |10|Jan 01 1970|M| |M|13| 1|
|10028 |Lee, Sandra |200|5844|Support |77000.00 | 4|Jan 01 1971|F| |M|18| 0|
|10029 |Berg, Andy |200|2312|Test |67000.00 |10|Jan 01 1967|M| |M|15| 0|
|10023 |Ayer, John |300|4432|Accounting |52000.00 | 8|Jan 01 1965|M| |M|13| 0|

as shown below,

.logon uname,pwd;

CREATE TABLE employ (
EmpNo SMALLINT NOT NULL,
Name VARCHAR(12),
DeptNo SMALLINT,
PhoneNo SMALLINT,
JobTitle VARCHAR(12),
Salary DECIMAL(8,2),
YrsExp BYTEINT,
DOB DATE,
Sex CHAR(1) UPPERCASE,
Race CHAR(1) UPPERCASE,
MStat CHAR(1) UPPERCASE,
EdLev BYTEINT,
HCap BYTEINT)
UNIQUE PRIMARY INDEX(EmpNo);

.begin loading employ errorfiles emperr1,emperr2 checkpoint 10000;

set record vartext "|";

define
EmpNo(varchar(9)),
Name(varchar(12)),
DeptNo(varchar(13)),
PhoneNo(varchar(4)),
JobTitle(varchar(12)),
Salary(varchar(19)),
YrsExp(varchar(12)),
DOB(varchar(11)),
Sex(varchar(11)),
Race(varchar(11)),
MStat(varchar(11)),
EdLev(varchar(12)),
HCap(varchar(12))

file=emps.txt;

insert into employ values (
:EmpNo,
:Name,
:DeptNo,
:PhoneNo,
:JobTitle,
:Salary,
:YrsExp,
:DOB,
:Sex,
:Race,
:MStat,
:EdLev,
:HCap
);

.end loading;
.logoff;

thanx all in advance

rgrds
terdataguy
8 REPLIES
Enthusiast

Re: fastload script insert phase error.

Insert a carriage return {ENTER} after the last record and try again.
Enthusiast

Re: fastload script insert phase error.

hi nithyanand,

i tried with entering a Carriage Return at the end of the last record but it still DOES NOT work.

thnx
N/A

Re: fastload script insert phase error.

Option 1:

if you are creating data file in a notepad ..make sure you have an end charater after last '|' for End of line

Option 2:
set record text "|";

Options 3:
|10021 |Brown, Jo |200|2312|Development |63000.00 |20|Jan 01 1955|F| |M|16| 0|
|10001 |Jones, Bill |100|5376|President |83000.00 |15|Jan 01 1960|M| |M|14| 0|
|10002 |Smith, Jim |100|4912|Sales |73000.00 |10|Jan 01 1970|M| |M|13| 1|


Make sure the all column having same byte lenght as define'd ..Ex ..add after 10021 four byte space to make as CHAR(9) as defined.

Options 4:
Try all three options it should work

Myls

Re: fastload script insert phase error.

give

set record vartext display_errors "|";

hope, it will work.
Enthusiast

Re: fastload script insert phase error.

Hi Bala chandra,

i tried to run the script by following what u said

set record vartext display_errors "|";

but,there were some errors ,

*** Expected DISPLAY_ERRORS, NOSTOP or a valid delimiter after a vartext keyword
*** Command Not processed
N/A

Re: fastload script insert phase error.

you need to press (Enter) on the last record.


Because on the last record Fastload fails to find a EOF character & terminates abruptly.

So you need to press Enter

Sample data :

1,abhi
2,hjjk
3,iiiii (Press Enter over here )

I hope this works ...
Enthusiast

Re: fastload script insert phase error.


Hi,



 



I have had a similar issue, and adding an Enter after the last record  solved it .



 



Thanks!


Enthusiast

Re: fastload script insert phase error.


But I'm getting a  unique issue...I have 543895 records and only 543894 are getting loaded into my table using fastload.



 



 



 Total Records Read              =  543895


     Total Error Table 1             =  0  ---- Table has been dropped


     Total Error Table 2             =  0  ---- Table has been dropped


     Total Inserts Applied           =  543894


     Total Duplicate Rows            =  1


 


I have used UTF -8 encoding in my file and also inserted a newline after the last record. 


 


Pls help !