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.
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;
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>