Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: save output


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: save output
Date   Tue, 20 Aug 2002 15:10:24 +0100

Philip Greenwood

> I'm wondering if there is a way save the entire output of 
> any given command to, say, a macro. 
> 
> (I am writing an ado file that runs commands on multiple 
> datasets and would like to be able to suppress output as in 
> -quietly-, but then re-display it with a message that is 
> particular to each dataset - but only if the given command 
> produces an output!)

You could accumulate output as a long string of characters
in a macro, punctuated by SMCL directives. The limits are
documented under -help limits-. 

Alternatively, you could route output using -file- as lines of 
text to a file and -type- that only under certain conditions. 
Again, SMCL directives would make that most attractive. 

Without knowing more about your problem, however, 
I suspect that there are more direct ways to tackle this. 

Nick 
n.j.cox@durham.ac.uk 
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index