Re: st: continue loop if file not found

If there is still the same problem, and I assume there is, although
this is not entirely clear from your post, get rid of the -break-
option. The -break- option causes Stata to break out of the loop,
while -continue- without -break- continues with the next element in a
loop. It does not continue with the next lines.
See this example (from the help file).
forvalues x = 1/10 {
if mod(`x',2) {
display "`x' is odd"
continue
}
display "`x' is even"
}
will loop 10 times. It will display numers 1 to 10 and inform you if
they are odd or even. I guess this is what you are looking for.
Compare the above loop with a modified version:
forvalues x = 1/10 {
if mod(`x',2) {
display "`x' is odd"
continue ,break
}
display "`x' is even"
}
This will not loop. Since 1 is an odd number, the loop will display "1
is odd", then exit.
In your case, the do-file exits the first time a file is not found.
also see -help continue-
Best
Daniel
*
* 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/