Dear Statalisters,
i have two datasets, were the most of the variables are equal, but the
varnames are completely different. I merge the two datasets:
****************
use "1.dta", clear
replace id = id+100
merge m:m id using "2.dta"
gen dataset =.
replace dataset=1 if id >100
replace dataset=2 if id <100
**********************
Now i want to join the Variables like:
replace Q_254509 = Q_254737 if _merge==2
Now my question,
is the a automatic way to find variables with the exact same varlabel
and then copy the value from the second variable to the first variable?
Do you have any ideas for this problem?
Jörg
*
* 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/