Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: foreach syntax


From   Devra Golbe <[email protected]>
To   [email protected]
Subject   st: foreach syntax
Date   Thu, 22 Jul 2004 11:21:31 -0400

hI,

I am trying to run a simple foreach loop, but my code is clearly not being parsed correctly, because the code below results in a "file not found" error, (as does the same code without the double quotes inside the foreach loop.) I've looked at the programming section of the User guide, but I can't find the source of my error, which is undoubtedly very simple. Can someone point me in the right direction?

Thanks,
Devra


****
local files "owner00r owner99r owner93r"
foreach file of local files {
clear
inputst "d:\Data\CGSData\`file'.wb2"
capture save "d:\Data\CGSData\`file''", replace
}

*****

______________________________________________________________
Devra L. Golbe, Professor
Dept. of Economics
Hunter College / CUNY
695 Park Ave., NY, NY 10021
voice: 212-772-5408
fax: 212-772-5398 (office)
208-361-5964 (e-fax)

http://econ.hunter.cuny.edu/faculty/golbe

*
* 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