Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Merging SDC M&A/CRSP/Compustat: some matches merge, some do not - why ?


From   [email protected]
To   [email protected]
Subject   st: Merging SDC M&A/CRSP/Compustat: some matches merge, some do not - why ?
Date   Fri, 07 Nov 2008 19:26:15 +0100

Hello folks,

after finding out how to merge the SDC M&A, CRSP, and Compustat  
databases I have a programming problem in STATA.

using the following merging process:

clear
set memory 800m
local j=1987
forvalues j=1987/2006 {
use  
"C:\Users\stock.GESS\Desktop\ResearchProjectM&A\M&Adata\M&A_Compustat_`j'.dta"
drop _merge
sort cnum smbl
merge cnum smbl using  
"C:\Users\stock.GESS\Desktop\ResearchProjectM&A\CRSPfiles\CRSP`j'_cnum_smbl.dta", update  
nokeep
drop _merge
sort cusip_8
merge cusip_8 using  
"C:\Users\stock.GESS\Desktop\ResearchProjectM&A\CRSPfiles\CRSP`j'_cusip_8.dta", update  
nokeep
drop _merge
replace permco=npermco
sort permco
merge permco using  
"C:\Users\stock.GESS\Desktop\ResearchProjectM&A\CRSPfiles\CRSP`j'_permco.dta",  
update nokeep
drop _merge
compress
save  
"C:\Users\stock.GESS\Desktop\ResearchProjectM&A\CRSPfiles\M&A_Compustat_CRSP`j'_merged.dta", update  
replace
clear
}

So has someone an idea why some matching companies merge (_merge=3)  
and others do not (_merge=5), even though the ticker symbols "smbl"  
and the 6-digit cusip "cnum" coincide in SDC M&A/Compustat/CRSP  
already in the first merging step ?

I merged the SDC M&A and Compustat data on the 6-digit cusip "cnum"  
and ticker "smbl" first. Then I tried with the code above to merge the  
CRSP data into the SDC M&A/Compustat data.

Kind regards and thanks for your help

Pascal Stock


*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index