Previous Page | Next Page

The SASECRSP Interface Engine

Example 33.8 Comparing PERMNO and GVKEY Access of CRSP Stock Data

You can access CRSP data using GVKEYs. Access in this manner requires the use of the CRSPLINKPATH= option, and is identical to access by its corresponding PERMNO(s). Links between PERMNOs and GVKEYs are used without reference to their active period. Link information is used solely for finding corresponding GVKEYs. This example shows two ways of accessing CRSP Stock data: one by PERMNOs and the other by its corresponding GVKEY. Several members are compared, showing they are equivalent.

   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);

Output 33.8.1 compares PERMNO with GVKEY access of CRSP Stock members STKHEAD, PRC, RET, ASKHI, AND VOL, showing that they are equal.

Output 33.8.1 Comparing PERMNO and GVKEY Access of CRSP Stock Data
Proc compare on vol between PERMNO and GVKEY

Obs PERMNO PERMCO COMPNO ISSUNO HEXCD HSHRCD HSICCD BEGDT ENDDT DLSTCD HCUSIP HTICK HCOMNAM HTSYMBOL HNAICS HPRIMEXC HTRDSTAT HSECSTAT
1 13638 325 60000324 428 3 11 1310 19721229 19921231 560 97789210   WOLVERINE EXPLORATION CO WEXC   Q A R
2 84641 325 60000324 0 2 11 1382 19970331 19980130 231 02351730   AMERAC ENERGY CORP     A A R

Previous Page | Next Page | Top of Page