Supressing Titles on .EXPORT command

UDA

Supressing Titles on .EXPORT command

I am trying to run BTEQ with a .EXPORT command as below...
cat << !* > $getpth

.logon $SCHEMA/$USER,$PASSWORD;
.EXPORT REPORT FILE = kbtstfile;

select APP_NAME, RUN_NAME, GROUP_NUMBER, RUN_ORDER
from
$DBPREFIX.dm_driver_steps_t
where
run_status = 'S' and
run_order = 40;

.EXIT
!*

Everything works and returns expected rows, but how can I get rid of the column headers and -------- that return below??

APP_NAME RUN_NAME GROUP_NUMBER RUN_ORDER
------------------------- ------------------------- ------------ ---------
edw STG_ODS 100 40
9 REPLIES
Enthusiast

Re: Supressing Titles on .EXPORT command

use (title '') for each filed.

select
APP_NAME(title ''),
RUN_NAME(title ''),
GROUP_NUMBER(title ''),
RUN_ORDER (title '')
from
$DBPREFIX.dm_driver_steps_t
where
run_status = 'S' and
run_order = 40;

use set underlines and titledashes to off.

--Sparan

Re: Supressing Titles on .EXPORT command

Sparan,
Thanks for the help. This solution is just what I needed.
Senior Apprentice

Re: Supressing Titles on .EXPORT command

Another way without specifying (title '') for each column:

.export DATA file=....
.set recordmode off

Exports in REPORT mode without any header...

But don't ask my WHY it's working this way :-)

Dieter

Re: Supressing Titles on .EXPORT command

Thanks Dieter
Enthusiast

Re: Supressing Titles on .EXPORT command

.SET TITLEDASHES OFF;
will do if you only want to get rid of the dashes.
Enthusiast

Re: Supressing Titles on .EXPORT command

I dont want headers to print, i am using (TITLE ''), but it is giving an extra comma in 1st line as below

.EXPORT REPORT FILE=${NOTIFY_DIR}/${NOTIFY_FILE_COR_SEM};

 .SET SIDETITLES OFF;

 .SET TITLEDASHES OFF;

 .SET WIDTH 5000;

 .SET SEPARATOR ',';

 .SET RECORDMODE OFF; 

 .SET FORMAT OFF ;

 .sET UNDERLINE OFF;

SELECT core_tb_name(TITLE '') ,sem_tb_name(TITLE '')  FROM ${CTRL_DB}.${CTRL_TBL_COR};

THE RESLUT IS , i get an  extra comma in the first line 

      ,

abc,xyz

zzz,rrr

Enthusiast

Re: Supressing Titles on .EXPORT command

Can you check if nulls or blank records are in table?

Enthusiast

Re: Supressing Titles on .EXPORT command

Thanks for the reply.

No there are no blanks or nulls in any of the columns in the table.

Enthusiast

Re: Supressing Titles on .EXPORT command

Hi,

You can use recordmode off

You can try this way:

select CAST( core_tb_name|| ',' ||

sem_tb_name|| '~' ||

(CASE WHEN anotherfield IS NULL

THEN '?'

ELSE ACC_CO_NO

END)..... AS CHAR( ) (TITLE '')

from ${CTRL_DB}.${CTRL_TBL_COR};

It means you cast all with no title.

It is a data issue.

Usually when I am in a hurry, since I port to unix, so I remove a line sed '1d' fileName.txt

Cheers,

Raja