FASTLOAD Error - Loading Fixed Length file to Table

Tools & Utilities

FASTLOAD Error - Loading Fixed Length file to Table

Hi Experts,

I'm getting the below error while loading flat file to Table using FL facility.  I'm new to TD and tried all the options to resolve the issue.  But, no luck.

My input file (EMP_FLAT) looks like below:

1xxx101000

2yyy202000

3zzz303000

My FL code is:

.SET RECORD UNFORMATTED;

SESSIONS 2;

.LOGON

DROP TABLE EREMP1;

DROP TABLE EREMP2;

DELETE FROM EMP;

DEFINE

:EID(CHAR(1)),

:ENM(CHAR(5)),

:ECD(CHAR(2)),

:ESAL(CHAR(5))

FILE=EMP_FLAT.TXT;

BEGIN LOADING EMP ERRORFILES EREMP1,EREMP2 CHECKPOINT 5;

INSERT INTO EMP (EMPID, EMPNAME, EMPCODE, EMPSAL) VALUES (:EID, :ENM, :ECD, :ESAL);

END LOADING

.LOGOFF

The error being hitting is -->

0008 BEGIN LOADING FPARTY

        ERRORFILES ERFPARTY, UVFPARTY

                CHECKPOINT 5;

**** 21:47:35 Number of AMPs available: 2

**** 21:47:35 BEGIN LOADING COMPLETE

     ===================================================================

     =                                                                 =

     =          Insert Phase                                           =

     =                                                                 =

     ===================================================================

0009 INSERT INTO FPARTY(PARTYID,PARTYNAME,PARTYCODE,PARTYINCOME)

        VALUES (:I_PID,:I_PNM,:I_PCD,:I_PINC);

**** 21:47:35 FDL4816 Statement rejected, cannot match elements with

              DEFINEs

              I_PID is not defined

              I_PNM is not defined

              I_PCD is not defined

              I_PINC is not defined

     ===================================================================

     =                                                                 =

     =          Logoff/Disconnect                                      =

     =                                                                 =

     ===================================================================

Any inputs on this would be highly appreciated.

Thanks in Advance.

1 REPLY
Teradata Employee

Re: FASTLOAD Error - Loading Fixed Length file to Table

Hi Kiranwt,

You need to remove the character ':' in front of the fields defined in the DEFINE command, it will become:

DEFINE

EID(CHAR(1)),

ENM(CHAR(5)),

ECD(CHAR(2)),

ESAL(CHAR(5))

FILE=EMP_FLAT.TXT;

Also, the fields in the input record must match with the DEFINE command. With the above DEFINE command, each record has 13 characters; while in your data file, each record has only 10 characters.

Thomas