Thank you Roger. That still did not work.
. clear
. #delim ;
delimiter now ;
. local files "MRecord-I-080907 MRecord-I-013107
MRecord-I-020807 MRecord-I-021507 MRe
> cord-I-030807
> MRecord-I-031507";
. #delim cr
delimiter now cr
.
. foreach fname in `files' {
2. inputst
"C:\statawrk\MAPMISS\`fname'.txt"
3. save `fname'.dta, replace
4. }
Stat/Transfer did not run successfully
file not found
r(601);
end of do-file
Ricardo.
--- "Newson, Roger B" <[email protected]> wrote:
> I think your -local- statement should read
>
> local files "MRecord-I-080907 MRecord-I-013107
> MRecord-I-020807
> MRecord-I-021507 MRecord-I-030807 MRecord-I-031507"
>
> or alternatively
>
> #delim ;
> local files "MRecord-I-080907 MRecord-I-013107
> MRecord-I-020807
> MRecord-I-021507 MRecord-I-030807 MRecord-I-031507";
> #delim cr
>
> I hope this helps. Let me know if it doesn't.
>
> Roger
>
>
> Roger Newson
> Lecturer in Medical Statistics
> Respiratory Epidemiology and Public Health Group
> National Heart and Lung Institute
> Imperial College London
> Royal Brompton campus
> Room 33, Emmanuel Kaye Building
> 1B Manresa Road
> London SW3 6LR
> UNITED KINGDOM
> Tel: +44 (0)20 7352 8121 ext 3381
> Fax: +44 (0)20 7351 8322
> Email: [email protected]
> Web page: www.imperial.ac.uk/nhli/r.newson/
> Departmental Web page:
>
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/pop
> genetics/reph/
>
> Opinions expressed are those of the author, not of
> the institution.
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On
> Behalf Of Ricardo
> Ovaldia
> Sent: 20 December 2007 17:51
> To: [email protected]
> Subject: st: Re: help with inputst
>
> Dear all,
>
> I have several data files in text format that I want
> to convert into Stata datasets using stat/transfer.
>
> I created a macro containing the text data file
> names
> and try to use -foreach- and -inputst- to read the
> data but it keeps giving me errors. It appears that
> stat/transfer can not understand the local macro.
>
> Here is my code:
>
> clear
> local files MRecord-I-080907 MRecord-I-013107
> MRecord-I-020807 MRecord-I-021507 MRecord-I-030807
> MRecord-I-031507
>
> foreach fname in `files' {
> inputst "C:\statawrk\MAPMISS\`fname'.txt"
> save `fname'.dta, replace
> }
>
> . qui {
> Stat/Transfer did not run successfully
> file not found
> r(601);
>
> end of do-file
>
> Thank you,
> Ricardo
>
> Ricardo Ovaldia, MS
> Statistician
> Oklahoma City, OK
>
>
>
>
>
________________________________________________________________________
> ____________
> Looking for last minute shopping deals?
> Find them fast with Yahoo! Search.
>
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
> *
> * 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/
>
> *
> * 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/
>
Ricardo Ovaldia, MS
Statistician
Oklahoma City, OK
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
*
* 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/