This is the SAS macro I write to consolidate and extract BHC's balance sheet
data from WRDS Bank Regulatory database. It creates a bhcf dataset in the work
directory.
The firm identifier in the Y-9C data is RSSD9001. To merge the BHC's balance
sheet data with Compustat/CRSP, I use the PERMCO-RSSD link table by the
Federal Reserve Bank of New York.1 I saved the most recent copy in my server,
and formatted it so that it can used directly. It is available at
https://mingze-gao.com/data/download/crsp_20181231.csv.
%let beg_yr = 1986;
%let end_yr = 2018;proc sql;createtable lnk asselect *
from crsp.ccmxpf_lnkhist
where linktype in ("LU", "LC") and (&end_yr+1 >= year(linkdt) or linkdt = .B) and (&beg_yr-1 <= year(linkenddt) or linkenddt = .E)
orderby gvkey, linkdt;quit;/* PERMCO-RSSD link table by New York FED */filename csv url "https://mingze-gao.com/data/download/crsp_20181231.csv";proc import datafile=csv out=work.crsp_20181231 dbms=csv replace; run;proc sql;createtable gvkey_permno_permco_rssd asselect *
from lnk join crsp_20181231 as fed
on lnk.lpermco=fed.permco;quit;
Note
Please run these programs on the WRDS cloud. You'll need to modify them
in order to run locally with SAS/Connect.