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
[email protected]
*
* 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/