Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Re: Temporary variables saved by accident
From
"Roger B. Newson" <[email protected]>
To
[email protected]
Subject
Re: st: Re: Temporary variables saved by accident
Date
Wed, 09 Jan 2013 16:03:40 +0000
Yes, the temporary variables ARE dropped from the dataset in memory when
the do-file stops executing. HOWEVER, they are not dropped from
already-saved dataset files. This is not really surprising (I think), as
it is probably not reasonable to expect Stata to modify and replace all
disk-file datasets created over the execution of a do-file, as part of
the termination sequence of the do-file.
You might like to do the saving between a -preserve- and a -restore-, or
even to use the SSC package -subsave-, which saves subsets of variables.
I hope this helps.
Best wishes
Roger
Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: [email protected]
Web page: http://www.imperial.ac.uk/nhli/r.newson/
Departmental Web page:
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/popgenetics/reph/
Opinions expressed are those of the author, not of the institution.
On 09/01/2013 15:52, Adrian Sayers wrote:
Hi Billy,
Honestly i would have thought temporary variables would be have more
like local macros.
Also the help file says they are dropped when the program or do file
concludes .
So if i save the file, clear the data set, why are they all not dropped,
so when i re-open the file they should not be there. After all my do
file did conclude.
It just seems strange behaviour for temporary variables to be made
permanent.
bw
A
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/