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

RE: st: RE: foreach syntax


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: foreach syntax
Date   Thu, 22 Jul 2004 16:54:56 +0100

The backward slash just before ` is the problem. See 
[U] 21.3.10 and use forward slashes instead, even 
under Windows. 

Nick 
[email protected] 

Devra Golbe
 
> Thanks, but that was just an unfortunate typo in my e-mail.  
> Here's exactly 
> the code which failed.  Note the input line fails before I 
> even get to the 
> save.  I've just checked (again) that the files are where I 
> think they are 
> (ie, d:\Data\CGSData\owner00r.wb2 does exist.)  Sorry for not 
> being clear 
> the first time.
> 
> ******
>   inputst d:\Data\CGSData\owner00r.wb2
> . clear
> 
> . local files "owner00r owner99r owner93r"
> . foreach file of local files {
>    2. clear
>    3. inputst d:\Data\CGSData\`file'.wb2
>    4. capture save d:\Data\CGSData\`file', replace
>    5. }
> Stat/Transfer did not run successfully
> file not found
> r(601);
> 
> ******
> . inputst d:\Data\CGSData\owner00r.wb2
> . clear
> 
> . local files "owner00r owner99r owner93r"
> . foreach file of local files {
>    2. clear
>    3. inputst "d:\Data\CGSData\`file'.wb2"
>    4. capture save "d:\Data\CGSData\`file'", replace
>    5. }
> Stat/Transfer did not run successfully
> file not found
> r(601);
> 
> end of do-file
> r(601);
> 
> 
> 
> 

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