format output of BTEQ in Unix

Tools & Utilities
Enthusiast

format output of BTEQ in Unix

trying to get the output of a bteq script in unix to format.  I am running a query to look at the top 10 worst queries.  the largest field is the sql text... the output looks bad and not easy to format once you move it to windows.  I am looking for a way to run this as automation and email the output so it is easy to read or easy to format. 

rm $output/suspquery.log

bteq <<EOF>> $output/suspquery.log

.RUN FILE=/opt/teradata/.pfiles/.logon_$1

.set width 9000

.set format on

.RUN FILE=$run/suspquery.btq

.set format off

EOF

mailx -s "Suspect Query Report" \john.p.smith@xxxxxxx.com < $output/suspquery.log

1 REPLY
Enthusiast

Re: format output of BTEQ in Unix

hi,

Am also trying to acheive the same but my output file should be an excel to the end users.

Trying to get database spae report and bad queries report.

Please help me if you alreayd done this