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

Re: st: Macro for log locations


From   sdriver@stata.com (Shannon Driver, StataCorp)
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Macro for log locations
Date   Wed, 02 Jul 2003 09:08:18 -0500

Nick Cox <n.j.cox@durham.ac.uk> wrote:

> > Fred Wolfe <fwolfe@arthritis-research.org> wrote:
> >
> > > Does anyone know how to obtain in a macro in OS Windows Stata 8.1:
> > >
> > > 1) the path and file name of a currently open log file
> > > 2) the path and file name of a currently open command log file
> >
> > You can get the path and filename of a currently open log file by using the
> > -log- command.  The path and filename of a currently open command log file
> > can be obtained by using the -cmdlog- command.  When these commands are
>>  issued with no arguments, the path and filename are stored in the saved
>>  results.

<snip>

> >
> 
> However, you must access these _before_ using any other
> command which is rclass or which uses rclass commands.
> 
> That is, if I
> 
> log using july2.log
> ret li
> 
> everything is fine, but if I do
> 
> log using july2.log
> ...
> su mpg
> ret li
> 
> then I cannot see what -log- left behind.

Actually, you can get this anytime you need it by using the -log- or -cmdlog-
command with no arguments.

log using july2.log
...
su mpg
ret list
log
ret list

--Shannon Driver
  sdriver@stata.com
*
*   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