EXPORT Command Creating What Looks Like Fixed Length Records

Database
Enthusiast

EXPORT Command Creating What Looks Like Fixed Length Records

Hi,

 Running v15 Teradata, and using the following export command, I'm getting what looks like fixed length or column records. I'm exporting SQL statements and what I want is variable length records based, of course, on how long the SQL statement is. 

 

I have a picture of the output and the export code here.

 

SHOULDN'T THIS output variable length records???/

 

Thanks In Advanced

Vmusic

OutputOutput

~     ~     ~     ~     ~     ~     ~    ~     ~     ~     ~     ~     ~    ~    ~.

EXPORT OUTFILE sqltbl09182016sample1.txt
MODE RECORD FORMAT TEXT;
SELECT
TRIM(L.QUERYID) || ' |' ||
TRIM(L.LOGDATE) || ' |' ||
TRIM(L.SQLTEXTINFO)
FROM
TX635.DBQLSQLTBL_SCR L,
TX635.DBQLOGTBL_SCR D
WHERE L.LOGDATE = D.LOGDATE
AND L.QUERYID = D.QUERYID
AND L.PROCID = D.PROCID
AND D.STATEMENTTYPE = 'SELECT'
SAMPLE 1000; 

  • export
  • log data
  • output
1 REPLY
Senior Apprentice

Re: EXPORT Command Creating What Looks Like Fixed Length Records

Well, actually these are variable length records, you probably don't want the first wo bytes per row which indicates the length of the following VarChar :-)

 

FastExport has no FORMAT to get readable delimited output, to fix this you can:

 

  • post process it using Unix command line to remove the first two bytes
  • write a simple OutMod to remove the first two bytes
  • use BTEQ EXPORT REPORT instead (for small exports)
  • use TPT Export with DELIMITED format (for large exports), then you don't have to concat the delimiter within the Select

I would prefer the last two.