Save output of mutlitple SHOW STATISTICS

General

Save output of mutlitple SHOW STATISTICS

In TD14 there is a SHOW STATISTICS statement where it outputs the definition statement statistics of a table. I am trying to create a refresh statistics script and I intend to use this feature so as to make fewer steps. Only problem is how can I save the output of the SHOW stats so I can run it again inside the same script.

SHOW STATISTICS ON customer;

*** Text of DDL statement returned.

*** Total elapsed time was 1 second.

--------------------------------------------------------------------

COLLECT STATISTICS

COLUMN ( CUST_ID ) ,

COLUMN ( ORG_UNIT_ID ) ,

COLUMN ( CORP_CUST_NBR ) ,

COLUMN ( SERV_PLN_EFF_DT ) ,

COLUMN ( CTRY_CD ) ,

COLUMN ( CORP_CUST_NBR ,CTRY_CD )

ON PROD_TBLS_KDW.customer;

Thanks for the help.

2 REPLIES
Enthusiast

Re: Save output of mutlitple SHOW STATISTICS

If you want to just save the output you can use .export in bteq

.export report file=<file path>

 *** To reset export, type .EXPORT RESET

 BTEQ -- Enter your SQL request or BTEQ command:

SHOW STATISTICS ON customer;

Enthusiast

Re: Save output of mutlitple SHOW STATISTICS

After export is complete as mentioned by Sachin, you can then run the same exported file within your same script using below command after .export reset.

.run file <file path>