Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Re: Generating tempfiles within a program for later use


From   David Kantor <[email protected]>
To   [email protected]
Subject   Re: st: Re: Generating tempfiles within a program for later use
Date   Mon, 07 Jan 2008 15:04:41 -0500

At 02:17 PM 1/7/2008, P. Wilner Jeanty wrote:
On Jan 6, 2008 4:40 PM, Beth Gifford <[email protected]> wrote:
> Hello all
>
> I have a data base with many tables (they represent students within
> schools and then provide additional details on students).
> What I want to do is to have a program for each  table ( that labels &
> recodes variables, etc) and that then creates a tempfile with a
> dataset that I can use to do the merging.  I'm very close but the
> tempfile gets overwritten when the next program runs.
> [...]

What Beth got as result is legitimate. It is not that the school
tempfile is overwritten by the student tempfile, but the school
tempfile vanishes itself. To be plain, tempfiles cannot be created
within a program for later use by another program. Anything that is
Temp disappears once the program execution is complete. They are
available for use only within the program that creates them (correct
me anyone if I am wrong); meaning once created, if they are not used,
they will be gone.
[...]
I'm not sure what the cause of Beth's problem is, but I believe that the assessment given by P. Wilner Jeanty was not correct.
I have used a scheme similar to Beth's many times with much success. I believe that the tempfile is erased when the context that defined the local is exited -- not when the context that saved the file is exited. Someone correct me if I am wrong.

--David

*
* 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index