Bookmark and Share

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]

st: RE: Postfile "forgets" the postfile


From   "Keith Dear" <[email protected]>
To   <[email protected]>
Subject   st: RE: Postfile "forgets" the postfile
Date   Thu, 24 Feb 2011 14:29:58 +1100

Sebastian,
Try -drop _all- instead of -clear-. As you suspected, -clear- closes postfiles.
Note: -postutil dir- lists open postfiles, useful for showing what's happened.
Keith

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Sebastian Eppner
Sent: Thursday, 24 February 2011 12:29 PM
To: [email protected]
Subject: st: Postfile "forgets" the postfile

...the typing error (using y instead of x) is not responsible... i
just saw it in the post, but in my do-file, i surely used the exact
same name all the times i referred to the postfile (i also changed it
several times, so its not because of some specially "bad" name).
thx for helping me out!
S

On Thu, Feb 24, 2011 at 2:21 AM, Sebastian Eppner <[email protected]> wrote:
> Hi,
>
> at some point in my code i define a postfile, in which i want to write
> 4 variables, say one two three four.
>
> . postfile x one two three four using somedataset, replace
>
> then open a forval loop and after some calculations i want to add new
> observations to the postfile, using the code:
>
> . post y (one) (two) (three) (four)
>
> unfortunately, at this point stata tells me:
> post x not found
> r(111);
>
> So apparently, Stata lost the postfile definition along the way somehow...
>
> I could track down the exact point at which Stata lost the
> information, which is a selfwritten ado.
> So the problem lies probably in the ado. I suspect the preserve /
> restore / clear combination i use in there. I am not an experienced
> ado writer, so please help me. the simplified structure of the ado is
> like this:
>
> program tuples2, rclass
>     version 9
>         syntax varlist(min=1 max=1 numeric) [if] [in]
> ....
> preserve
> clear
>
> set obs2
> .....do some stuff
> .....write the results i am interested in into return macros
> restore
> end
>
>
> Could this "clear" be responsible for the damage? If yes, is there
> another way I can "start from scratch" in the ado file (and in the end
> restore the damage done) while NOT hurting the postfile definition?
>
> Thanks for a little help.
> Sebastian
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/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/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/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index