Using WRDS to connect RavenPack data with Compustat data
Linking RavenPack with Compustat (NA)
RavenPack (/wrds/ravenpack/sasdata/
) is a database that extracts information on named entities with sentiment, and financially-relevant events from the unstructured content of thousands of publications. In WRDS, RavenPack contains a file named WRDS_COMPANY_NAMES
(/wrds/ravenpack/sasdata/common
) that contains the identifiers ( RP_ENTITY_ID, ISIN, CUSIP, and TICKER). Ravenpack’s CUSIP (9-character cusip) could be used to link with Compustat’s CUSIP (9-character cusip). This sample code shows the procedure:
proc sql;
create table raven_comp as select unique
a.rp_entity_id, b.cusip, b.gvkey
from rpna.wrds_company_names(where=(cusip ne '')) as a,
comp.names(where=(cusip ne '')) as b
where a.cusip = b.cusip;
quit;
Linking RavenPack with Compustat Global
To link RavenPack data with Compustat Global data, begin by using the RavenPack WRDS_COMPANY_NAMES
file as shown in the instructions above. Then, merge the WRDS_COMPANY_NAMES
with the Compustat Global data by using the ISIN. The following sample code shows the procedure for linking the identifiers of both databases:
proc sql;
create table raven_compg as select unique
a.rp_entity_id, a.isin, b.gvkey
from rpna.wrds_company_names(where=(isin ne '')) as a,
compg.names_g(where=(isin ne '')) as b
where a.isin = b.isin;
quit;