Merge Compustat and CRSP¶
Using the CRSP/Compustat Merged Database (CCM) to extract data is one of the fundamental steps in most finance studies. Here I document several SAS programs for annual, quarterly and monthly data, inspired by and adapted from several examples from the WRDS.1
GVKEY-PERMNO
link table¶
First, we need to create a GVKEY-PERMNO
link table.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
Link Type | Description |
---|---|
LC | Link research complete (after extensive research by CRSP). Standard connection between databases. |
LU | Link is unresearched by CRSP. It is established by comparing the Compustat and historical CRSP CUSIPs. LU represents the most popular link type. |
LS | Link valid for this security only.2 |
LX | Link to a security that trades on foreign exchange not included in CRSP data. |
LD | Duplicate link to a security. Two GVKEYs map to a single PERMNO (PERMCO ) during the same period, and this link should not be used. Almost all of these cases happened before 1990. |
LN | Primary link exists but Compustat does not have prices.3 |
NR | No link available; confirmed by research. |
NU | No link available; not yet confirmed. |
According to WRDS's support page:
- Primary link types (
LC
,LU
andLS
) account for 41% of the links in CCM. - Secondary link types (
LX
,LD
andLN
) account for only 2%. - Non-matching link types (
NR
andNU
) account for the rest 57%, which is expected because of the different coverage of the two databases.
Generally, using LC
and LU
should be sufficient.
Compustat Annual and CRSP¶
Example ccmfunda.sas
.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Compustat Quarterly and CRSP¶
Example ccmfundq.sas
.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Compustat Monthly and CRSP¶
To be done.
-
WRDS Overview of CRSP/COMPUSTAT Merged:
https://wrds-www.wharton.upenn.edu/pages/support/manuals-and-overviews/crsp/crspcompustat-merged-ccm/wrds-overview-crspcompustat-merged-ccm/
Use CRSP-Compustat Merged Table to Add Permno to Compustat Data:
https://wrds-www.wharton.upenn.edu/pages/support/research-wrds/macros/wrds-macro-ccm/
Merging CRSP and Compustat Data:
https://wrds-www.wharton.upenn.edu/pages/support/applications/linking-databases/linking-crsp-and-compustat/ ↩ -
Other CRSP
PERMNOs
with the samePERMCO
will link to otherGVKEYs
.LS
links mainly relate to ETFs where a single CRSPPERMCO
links to multiple CompustatGVKEYs
. In Compustat, even though they may belong to the same investment company (e.g. ISHARES), ETFs are presented with differentGVKEYs
and CRSP flags this situation. ↩ -
Prices are used to check the accuracy of the link. For linktype LN there is no price information available even on a quarterly or annual basis. The user will have to decide whether or not to include these links. ↩
Created: May 24, 2020