How to suppress column headings in BTEQ

Tools
N/A

How to suppress column headings in BTEQ

I would like to suppress the column heading and underscore output from the following BTEQ script. Please could you let me know how to do this, the manual seems to omit this option. I can get round it using the tail command in UNIX but it would look more professional if it could be done in BTEQ.

.run file logon.txt
.export report file=/badata/wtdata/tdata_count.txt
.set format off
select count(*) from TABLEA;
.EXPORT RESET
.LOGOFF
.EXIT

Count(*)
-----------
1186

By the way I notice my file is written to incrementally every time I run the BTEQ script. Is there a command to overwrite the content on every run? Again I can work round this by deleting the file in the Unix script at the start of the run but it would look better to do this in one hit with the BTEQ script.

Thanks for your help,

Susan
2 REPLIES

Re: How to suppress column headings in BTEQ

To Supress column Heading in Bteq export (Report mode), Use (TITLE '') at the end of your Select List.

e.g.

select count(*) AS REC_CNT (TITLE '') from TABLEA;

Alternatively you can also try to Export it it DATA mode.
N/A

Re: How to suppress column headings in BTEQ

Thanks, Wiinter09, you set me on the right track. I tried your suggestion and had the following error message from BTEQ

select count(*)as REC_CNT (TITLE '') from TABLEA;
$
*** Failure 3707 Syntax error, expected something like ';' between the word
'REC_CNT' and '('.
Statement# 2, Info =30
*** Total elapsed time was 1 second.

I had a look in the manual for examples of TITLE and found that if you miss out the "as" clause it works beautifully. i.e.

select count(*) (TITLE '') from TABLEA;

Many thanks for your help,

Susan