Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Jenniffer Solorzano Mosquera" <Jenniffer.Solorzano.Mosquera@jibs.hj.se> |
To | <statalist@hsphsun2.harvard.edu> |
Subject | st: reclink problem |
Date | Wed, 02 May 2012 18:33:21 +0200 |
Sorry this is the real query Hi everyone, I'm trying to merge 2 databases by name using the reclink command. The only variable I want to match is the name because I don't have anything else in common between the two databases. I run the following command: import excel using allfirms2, clear firstrow sheet("Sheet1") cellrange(D2:F33140) sort Targetname drop if Targetname==Targetname[_n-1] g id1=_n save allfirms2, replace // The big database import excel using PE_firms_thomson_notfoundyetAmadeus, clear firstrow sheet("no duplicates") cellrange(A1:F910) rename CompanyName Targetname sort Targetname drop if Targetname==Targetname[_n-1] g id2=_n save notfoundyetfirms, replace // The companies I need to find in there, but names can be written different reclink Targetname using allfirms2, gen(myscore) idmaster(id1) idusing(id2) However for some reason I have an error and it doesn't find id1?? reclink needs to add more variables to find a score or it is enough with only one variable? This is the error: - version 7 - foreach word of local 0 { - foreach word of local 0 { - if `"`word'"' == "using" { = if `"id1"' == "using" { Isid_using `0' local break break continue, break } - } - if "`break'" != "" { = if "" != "" { exit } - syntax varlist [, Sort Missok ] variable id1 not found Thanks in advance for any suggestion! * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/