Resources

Comparing PERMNO and GVKEY Access of CRSP Stock Data

/*----------------------------------------------------------------

                    SAS Sample Library

        Name: crpex08.sas
 Description: Example program from SAS/ETS User's Guide,
              The SASECRSP Interface Engine
    Title: Comparing PERMNO and GVKEY Access of CRSP Stock Data    
  Product: SAS/ETS Software
     Keys: Stock data access, CRSPAccess, CRSPLINKPATH= option
           CCM data access, PERMNO, GVKEY 
    Procs: SASECRSP
    Notes:                      
        Read this before you run this sample.                 
        The Stock database resides in the CRSP_MSTK folder.
        The CCM data and crsplinkpath reside in the        
        CRSP_CST folder. You can set "%sysget(CRSP_MSTK)"  
        to point to your copy of the stock data in the filename  
        statement(s) below with the path to your copy of   
        the data, in quotes. You can also set "%sysget(CRSP_CST)"  
        to point to your copy of the CCM data in the filename  
        statement(s) below with the path to your copy of   
        the data, in quotes.                              

libname crsp2 sasecrsp "%sysget(CRSP_MSTK)"
        setid=20
        crsplinkpath="%sysget(CRSP_CST)"
        gvkey=1544
        range='19900101-19910101';
----------------------------------------------------------------*/
title 'Comparing PERMNO and GVKEY access of CRSP Stock data';

libname _all_ clear;
libname crsp1 sasecrsp "%sysget(CRSP_MSTK)"
        setid=20
        permno=13638 permno=84641
        range='19900101-19910101';

libname crsp2 sasecrsp "%sysget(CRSP_MSTK)"
        setid=20
        crsplinkpath="%sysget(CRSP_CST)"
        gvkey=1544
        range='19900101-19910101';

title1 'PERMNO=13638 and PERMNO=84641 access of CRSP data';
proc print data=crsp1.stkhead;
run;

%macro compareMember(memb);
   title1 "Proc compare on &memb between PERMNO and GVKEY";
   proc compare base=crsp1.&memb compare=crsp2.&memb brief;
   run;
%mend;

%compareMember(stkhead);
%compareMember(prc);
%compareMember(ret);
%compareMember(askhi);
%compareMember(vol);