Skip to content

Instantly share code, notes, and snippets.

@joosti
Created January 1, 2015 21:53
Show Gist options
  • Save joosti/5308e2605bcd057494c4 to your computer and use it in GitHub Desktop.
Save joosti/5308e2605bcd057494c4 to your computer and use it in GitHub Desktop.
SAS CRSP DSENAMES
/* Retrieve historic cusip
work.myDset holds permno and datadate (end of fiscal year)
Appends historic cusip (at time datadate)
*/
proc sql;
create table work.withCusip as
select a.*, b.ncusip
from work.myDset a, crsp.dsenames b
where
a.permno = b.PERMNO
and b.namedt <= a.datadate <= b.nameendt
and b.ncusip ne "";
quit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment