Problems loading fixed length file via TPT Load operation (TTU 15.10)

Teradata Applications

Problems loading fixed length file via TPT Load operation (TTU 15.10)

I am trying to use TPT to load a fixed length file via Linux client (TTU 15.10).

The "problem" is that the file though defined as fixed length, sometimes does not have a value in FIELD3, in which case there is a line feed ending the record.

Is there still a way to use TPT to load the file?

Here is VARCHAR WorkingDatabase

);

DEFINE SCHEMA W_0_s_DATABASE_PRD_TBL_XXXX

(

"FIELD1" char(51),

"FIELD2" char(10),

"FIELD3" char(15)

);

DEFINE OPERATOR W_0_o_DATABASE_PRD_TBL_XXXX

APPLY ('INSERT INTO MEDECON_PRD.TBL_BCBSLA_MBRSHIP_01042016

(

"FIELD1",

"FIELD2",

"FIELD3"

) VALUES (

:"FIELD1",

:"FIELD2",

:"FIELD3"

);')

TO OPERATOR (W_1_o_MEDECON_PRD_TBL_BCBSLA_MBRSHIP_01042016[1]

ATTRIBUTES (

Username = 'username',

UserPassword = 'xxxxxxxx',

LogTable = 'DATABASE_PRD.TBL_XXXX_LOG',

TargetTable = 'DATABASE_PRD.TBL_XXXX',

TdpId = 'teradataa1'

))

SELECT * FROM OPERATOR (W_0_o_MEDECON_PRD_TBL_BCBSLA_MBRSHIP_01042016[1]

ATTRIBUTES (

Filename = 'TextDoc.txt',

Format = 'Unformatted',

OpenMode = 'Read',

SkipRows = 1,

DirectoryPath = '/ccx/home/username/DATAFILES/xxxxx',

IndicatorMode = 'N')

1 REPLY

Re: Problems loading fixed length file via TPT Load operation (TTU 15.10)

If someone can help with this, i'd really appreciate.   To recap, i have a "fixed length file" i am trying to load.   The problem is the length of each field in the file is fixed, but sometimes there is no value in the final field, and instead of spacing it out with blanks, a line feed X'0a' is used to end the record.  i am pulling my hair out trying out different options to get the TPT load operator to work, using all different file formats, including TEXT, UNFORMATTED, and DELIMITED.  I was thinking i could try to trick it into treating the line feed (X'0a') as a delimiter, but of course that did not work at led to a column length overflow error.  When i use TEXT or UNFORMATTED, i have to specify the fixed length of each field in the file, and then i get recprd byte count errors because the final field in a particular record is not spaced out to the end of the record.

Is there a way to get TPT to load the file?  Please help!!