Resources

Retrieving Stock Time Series by PERMNO

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

                    SAS Sample Library

        Name: xcmex06.sas
 Description: Example program from SAS/ETS User's Guide,
              The SASEXCCM Interface Engine
    Title: Retrieving Stock Time Series by PERMNO
  Product: SAS/ETS Software
     Keys: CCM Data Access, CRSPAccess, ITEMLIST=, PERMNO= Option
    Procs: SASEXCCM
    Notes: Read this before you run this sample.
           The CRSP US Stock and Indices database resides
           in the CRSP_MSTK folder. You
           must install your CRSP Stock database
           and define your Windows system environment
           variable, CRSP_MSTK, to point to the physical path
           of your installed CRSP Stock database. If you define
           CRSP_MSTK=\\tappan\crsp1\data201008_little\MIZ201006\,
           then you can use the following equivalent form
           of the libname statement:

libname crsp sasexccm
   "%sysget(CRSP_MSTK)"
   setid=20
   permno=12490
   itemlist="MPRC;MASK;MBID";

           For clarity, this example is showing the actual physical
           path to the CRSP US Stock and Indices Database. You will
           use your own physical path to your data instead of the one
           shown below.
----------------------------------------------------------------*/

title 'Retrieve IBM Monthly PRC, ASK, and BID by PERMNO Access';
libname _all_ clear;

libname crsp sasexccm
   "\\tappan\crsp1\data201008_little\MIZ201006\"
   setid=20
   permno=12490
   itemlist="MPRC;MASK;MBID";

data mstkts_all( where=( mcaldt >= '30jun2008'd) ) ;
   set crsp.mstk_ts;
run;
proc contents data=mstkts_all;
run;
proc print data=mstkts_all;
run;