Created
August 5, 2021 20:44
-
-
Save edwinhu/661558a04129b44ec48769e9d8b1e25d to your computer and use it in GitHub Desktop.
S&P 500 Constituents from CRSP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc sql; | |
create table out.sp500 as | |
select distinct a.permno, a.date, | |
a.permco, | |
c.ncusip as CUSIP, | |
c.exchcd, | |
c.tsymbol, | |
c.shrcls | |
from crsp.msf a, | |
crsp.msp500list b, | |
crsp.msenames c | |
where a.permno = b.permno | |
and b.start <= a.date <= b.ending | |
and a.permno = c.permno | |
and c.namedt <= a.date <= c.nameendt | |
and year(a.date) ge 2011 | |
order by a.permno, a.date; | |
quit; | |
proc print data=&syslast.(obs=25) width=min;run; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment