Hi,
Suppose I want to create 2 temporary datasets inside a -forval- loop, with
names indexed by the loop number (i.e., `results0', `results1'). Once I get
outside the loop, I want to append them using -dsconcat-, but since I
defined them inside the loop, they no longer exist.
A more concrete example:
forval k = 0(1)1 {
tempname memhold
tempfile results
postfile `memhold' var1 var2 var3 using `results'`k', replace
forval y = 1998(1)2002 {
...
post `memhold' (`x') (`y') (`z')
}
postclose `memhold'
}
dsconcat `results0' `results1'
Could someone offer a suggestion on how to do this, please? Much thanks.
--
Danielle H. Ferry
National Bureau of Economic Research
365 Fifth Avenue, 5th Floor
New York, NY 10016
*
* 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/