Dear stata listers
I need help in correcting my programming code to merge data set. I am
using stata 10.
I have 7 stata data files which I need to merge. I wrote code for this
but it is only merging last data file to the first one. Please suggest
me something on this, my code is
clear
set mem 700m
set more off
tempfile mydata
foreach l of numlist 4/9 {
use lev3_1.dta
merge commonid using lev`l'_1.dta
capture merge using `mydata'
ren _merge merge3_`l'
save `mydata', replace
}
Please suggest me that where is the mistake happening in this code.
Regards
Prakash
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/