Fastload: Incorrect number of bytes returned from a File Read

Tools
Enthusiast

Fastload: Incorrect number of bytes returned from a File Read

Hi there,

Could anybody help me to look at this? Thanks in advance!

I met some problems when I use fastload:
error messages:
Incorrect number of bytes returned from a File Read!

The flat file:
001371|104880|Q|12|13|41|1|1|1|1|2|1|2|2|2|1|2|2|1|0|2|1|1|2|2|1|2|2|2|1|2|
001371|780460|Q|101|0|0|0|0|10|91|1|1|0|0|0|1|1|1|1|0|0|0|1|1|1|1|0|0|0|1|1|

The script:
#!/bin/ksh
TABLENAME=$dbLoad.xxx_fcstval
LOGFILE=$XXX/scripts/LOG/xxx_fastload.log
rm -rf $LOGFILE
fastload &1
.sessions 6
.tenacity 1
.sleep 1
.logon $dbServ/$dbUser,$dbPass;
DATABASE $dbLoad;
.set record formatted
.set record text '|'
.set record unformatted
DROP TABLE $TABLENAME;
DROP TABLE ${TABLENAME}_err1;
DROP TABLE ${TABLENAME}_err2;
CREATE TABLE $dbLoad.lh_lcl_fcstVal ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL
(
locationid CHAR(6) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
productnumber INTEGER NOT NULL,
contributioncode CHAR(1) CHARACTER SET LATIN NOT CASESPECIFIC,
dailyregfcst01 INTEGER,
........
dailyregfcst28 INTEGER)
PRIMARY INDEX ( locationid,productnumber );

DEFINE
locationid(char(6)),
productnumber(integer),
unitofMeasure(char(1)),
dlyfcst01(integer),
.............
dailyregfcst28 INTEGER)
PRIMARY INDEX ( locationid,productnumber );
.os touch fastload.input;

BEGIN LOADING $TABLENAME ERRORFILES ${TABLENAME}_err1, ${TABLENAME}_err2;
insert into $dbLoad.xxx_fcstVal
values(
:locationid
, :productnumber
, :unitofMeasure
, :dlyfcst01
, :dlyfcst02
.........
, :dlyfcst28);

.end loading

.logoff

.quit
!EOF
-----the end------

thanks!!!
4 REPLIES
Enthusiast

Re: Fastload: Incorrect number of bytes returned from a File Read

anyone knows the answer? thx again!
Teradata Employee

Re: Fastload: Incorrect number of bytes returned from a File Read

.set record vartext

Also the DEFINE describes the input file, not the table. In particular, if you use VARTEXT all DEFINE fields must be declared VARCHAR. The values will be translated to internal format during the load.
Enthusiast

Re: Fastload: Incorrect number of bytes returned from a File Read

HI

ERRR IN THE DEFINE STATEMENT.
Fan

Re: Fastload: Incorrect number of bytes returned from a File Read

Sometime teradata behaves strangely... this error may be coming because of incorrect order of fileds in the control file. Recheck/regenerate the control file and try again.

I had faced this error and I had used the above mentioned step to resolve the issue.

Sushant.