Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Postfile "forgets" the postfile

From   Sebastian Eppner <>
Subject   st: Postfile "forgets" the postfile
Date   Thu, 24 Feb 2011 02:21:16 +0100


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

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]

set obs2 some stuff
.....write the results i am interested in into return macros

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.

*   For searches and help try:

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