Error while loading data from specific row number using Multiload

Tools
Enthusiast

Error while loading data from specific row number using Multiload

I have a csv file having some rows with less columns causing issues during loading using MULTILOAD. I am getting error-- Access module error '61' received during 'pmReadDDparse'  operation: 'Warning, too few columns !ERROR! Delimited Data Parsing error: Too few columns in row 1524856'.

I know the row which has less columns (say in this case it is row # 1524856) . So to skip the load of that row, i am initially loading my data from RECORD 2 FOR 1524855 which works perfectly fine. But when i am skipping the error row and loading FROM 1524858 THRU <the last record>, i am still getting the above error. Find below the MLOAD script that is written for the same:

#!/bin/ksh

mload << !

.LOGTABLE DBNAME.TEST_LOGTABLE_MLOAD;

.LOGON tpid/userid,password;

DROP TABLE DBNAME.TEST_WT;

DROP TABLE DBNAME.TEST_ET;

DROP TABLE DBNAME.TEST_UV;

.BEGIN IMPORT MLOAD TABLES DBNAME.TEST

     WORKTABLES  DBNAME.TEST_WT

     ERRORTABLES DBNAME.TEST_ET

                 DBNAME.TEST_UV

        ERRLIMIT 5000

;

.LAYOUT TEST_LAYOUT;

          .FIELD COL1 * VARCHAR(100);

          .FIELD COL2 * VARCHAR(100);

          .FIELD COL3 * VARCHAR(100);

          .FIELD COL4 * VARCHAR(100);

          .FIELD COL5 * VARCHAR(100);

          .FIELD COL6 * VARCHAR(100);

          .FIELD COL7 * VARCHAR(100);

          .FIELD COL8 * VARCHAR(300);

          .FIELD COL9 * VARCHAR(300);

          .FIELD COL10 * VARCHAR(100);

.DML LABEL INSERT_TEST;

INSERT INTO DBNAME.TEST

(

      COL1,

      COL2,

      COL3,

      COL4,

      COL5,

      COL6,

      COL7,

      COL8,

      COL9,

      COL10

) VALUES

(

      :COL1,

      :COL2,

      :COL3,

      :COL4,

      :COL5,

      :COL6,

      :COL7,

      :COL8,

      :COL9,

      :COL10

)

;

.IMPORT INFILE /data/testdata.csv

        FROM 2  FOR 1524855

        FORMAT VARTEXT  ','

LAYOUT  TEST_LAYOUT

APPLY INSERT_TEST

;

.END MLOAD;

.LOGOFF;

!

Above run was successful.

To skip error record and do the load, i gave IMPORT statement as below:

.IMPORT INFILE /data/testdata.csv

        FROM 1524858 THRU <last record>

        FORMAT VARTEXT  ','

LAYOUT  TEST_LAYOUT

APPLY INSERT_TEST

;

Getting the error: Access module error '61' received during 'pmReadDDparse'  operation: 'Warning, too few columns !ERROR! Delimited Data Parsing error: Too few columns in row 1524856'.

Looks like it is trying to read the data again from RECORD 1 for the above import.

Please suggest how to skip the error record and continue the data loading.

1 REPLY
Teradata Employee

Re: Error while loading data from specific row number using Multiload

MultiLoad needs the rows/records to be in the correct format in order to skip them because it parses every row before deciding whether the row is actually thrown away or not.

On the other hand, TPT does allow for the handling of data records with too few and too many columns.

-- SteveF