MLOAD Error - An invalid statement was found before the .LOGON statement

Tools

MLOAD Error - An invalid statement was found before the .LOGON statement

I'm new to Teradata and am running into an error trying to execute an MLOAD process.  I keep getting the error "An invalid statement was found before the .LOGON statement" and no matter what I've tried I can't seem to get past this.  Even the people in my department who are familiar with teradata seem stumped.

Please help!!!

My script looks like this...

.LOGTABLE RTLTM.JCP_RWD_OFF_EARNED_CUST_LOG;

.LOGON TDPX/LOADJCP,;

.BEGIN MLOAD TABLES RTLTM.JCP_RWD_MTHLY_OFF_EARNED_CUST

        WORKTABLES RTLTM.JCP_RWD_OFF_EARNED_CUST_WK1

        ERRORTABLES RTLTM.JCP_RWD_OFF_EARNED_CUST_ER1

                    RTLTM.JCP_RWD_OFF_EARNED_CUST_ER2

        ERRLIMIT 1;

.LAYOUT DATAIN_REC;


.FIELD CUST_ID                      * CHAR(9);

.FIELD NBR_EARNED_OFFLINE_RWD_ACCTS * CHAR(3);

.FIELD TOTAL_NBR_EARNED_RWDS        * CHAR(3);

.FIELD RWD_YR                       * CHAR(4);

.FIELD RWD_MTH                      * CHAR(2);

.DML LABEL INSDATA;

 INSERT INTO RTLTM.JCP_RWD_MTHLY_OFF_EARNED_CUST

  VALUES

   (:CUST_ID

   ,:NBR_EARNED_OFFLINE_RWD_ACCTS

   ,:TOTAL_NBR_EARNED_RWDS

   ,:RWD_YR

   ,:RWD_MTH

  );

.IMPORT INFILE DATAIN

     LAYOUT DATAIN_REC

     APPLY INSDATA;

.END MLOAD;

.LOGOFF;


5 REPLIES
Teradata Employee

Re: MLOAD Error - An invalid statement was found before the .LOGON statement

Are you sure you do not have any hidden characters in the file prior to the .logtable command or in between the .logtable and the .logon command?

-- SteveF
N/A

Re: MLOAD Error - An invalid statement was found before the .LOGON statement


.LOGON TDPX/LOADJCP,;  you need to remove ', ' in that statement and try

Re: MLOAD Error - An invalid statement was found before the .LOGON statement

I am also facing a similar problem and getting the same error for my fast export script. I have used the same format for another script and that is working fine. I checked this script throughly and am still not able to get where I did the mistake. Can some one please help me out here. here are the first 4 lines of the script

:

.LOGTABLE ABC.WORK_TBL;

.RUN FILE LOGON_FILE;

.SET MAXERROR 1;

DATABASE DBNAME;

ABC.WORK_TBL - work table

LOGON_FILE - .logon file containing .logon tdpid/Loginid,pwd;

Thanks

Teradata Employee

Re: MLOAD Error - An invalid statement was found before the .LOGON statement

Well, we have tried this inhouse and do not have any problems with:

.logtable  . . . . ;

.run file . . . . ;

.set maxerror . . . ;

database . . . ;

and we do not get any type of errors (assuming the file for the RUN FILE command has the .logon statement).

Please post the entire output from the job.

And the job script as well.

-- SteveF

Re: MLOAD Error - An invalid statement was found before the .LOGON statement

Please update yor TTU to newer version, that will fix the problem , TTU 7 and older versions are may not compatable with your code.