BTEQ Import of SAP pipe delimited text file with headers & footers

Tools

BTEQ Import of SAP pipe delimited text file with headers & footers

Can anyone help me in trying to load a pipe delimited text file with headers and footers?

I have been trying to load the file in one column VARCHAR(300) to then use some code to search for each | and extract each field in turn.

I am using BTEQ import as file is small but having trouble with loading - error message = *** Failure 3857 Cannot use value (or macro parameter) to match 'DUMMY_FIEL
D'.

script looks like:

DATABASE U_CSMIDB;

.if errorcode !=0 then .quit errorcode

CREATE TABLE WT4204_WBS_PROJECT_LOAD
(
DUMMY_FIELD VARCHAR(300)
)
PRIMARY INDEX (DUMMY_FIELD)
;;

.if errorcode !=0 then .quit errorcode

.IMPORT VARTEXT FILE=\XXXX.net\td_automation\DATA\2497.tdd ;

.if errorcode !=0 then .quit errorcode

.REPEAT*

.if errorcode !=0 then .quit errorcode

USING (COL1 VARCHAR(300))

INSERT INTO WT4204_WBS_PROJECT_LOAD
(DUMMY_FIELD
)
VALUES (:DUMMY_FIELD
);

quit 0;
.label script_quit
quit 16;