Export output file formatting

Tools & Utilities
Enthusiast

Export output file formatting

Hi Guys,

I am using an export command in a BTEQ script. The output file needs to be formatted to get the a comma, pipe(|) or ~ delimited file. Can you guys please help me in this regard? The SQL Statement that I am passing to do this Export command is dynamic, hence can not be pre appended with any of the delimiters.

The Code snippet would look like this

.EXPORT DATA FILE=$TABLE_NAME.txt
/**************************************************************************************************
Run the select statement in the file created by shell script
**************************************************************************************************/
. run file $COL_FILE_NAME

Content of the $COL_FILE_NAME is something that would change dynamically during execution
2 REPLIES
Junior Supporter

Re: Export output file formatting



Take a look at the Linux/Unix 'sed' command.

HTH.

Cheers.

Carlos.
Enthusiast

Re: Export output file formatting

You cannot do it if you are exporting a DATA file.
If you can do an EXPORT REPORT, you can:

.SEPARATOR '|'

(or whatever separator you want.)

If you do this, everything will come out as characters, you must suppress pagelength/ headings and column headings (you can only do this in your SQL), and the maximum line length is 265 characters.