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

st: RE: RE: multiple merge


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: multiple merge
Date   Tue, 6 Aug 2002 17:28:55 +0100

Wenjun Li replied to Alejandro Riano 
> 
> If the files are named as file_1, file_2, .... file_500 or 
> the alike, you
> try to use Stata's "for" command, e.g.
> 
> foreach fileno in 1/500 {
> 	use file_`fileno', clear
> 	cap drop _merge
> 	sort date
> 	save, replace
> }
> 
> use file_1, clear
> foreach fileno in 2/500 {
> 	cap drop _merge
> 	merge date using file_`fileno', nok
> 	drop _merge
> 	sort date
> }
> 

Should be 

foreach fileno of num 1/500 { 

etc. 


Nick 
n.j.cox@durham.ac.uk 

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index