Getting Started: SASEXCCM Interface Engine

To specify what parts of the database to access, you supply two things: the appropriate keys for companies or securities you want to access, and the list of data items you want to retrieve.

When accessing CCM data, you select the companies you want to access by specifying the GVKEY for each company. GVKEY is Compustat’s unique identifer and primary key. You use the GVKEY= option to specify which GVKEY to include. If no GVKEYs are specified, data for all companies are retrieved. You can use this feature to obtain a list of all companies (including their name and GVKEY) in the CCM database, as shown in Example 39.5.

For example, the following statements access the CCM database for annual sales data for IBM (GVKEY=6066) and Microsoft (GVKEY=12141):

   LIBNAME myLib sasexccm 'physical-name'
      SETID=250
      GVKEY=6066   /* IBM */
      GVKEY=12141  /* MSFT */
      ITEMLIST='SALE';
   data yrlysale;
      set myLib.annitem;
   run;

When accessing CRSP Stock (STK) data, you select the securities you want to access by specifying their PERMNOs. You specify a PERMNO to include with the PERMNO= option. If no PERMNOs are specified, data for all securities in the database are retrieved. You can use this feature to obtain a list of all PERMNOs in the STK database.

For example, the following statements access the STK database for monthly shares data for IBM (permno=12490) and Microsoft (permno=10107):

   LIBNAME myLib sasexccm 'physical-name'
      SETID=20
      PERMNO=12490   /* IBM */
      PERMNO=10107  /* MSFT */
      ITEMLIST="MSHROUT.*;MSHRFLG.*";
   data mshares_all;
      set myLib.mshares;
   run;

When accessing CRSP Indices (IND) data, you select the security and indices data from the CRSP Daily or Monthly Stock and Indices database by specifying their INDNOs. You specify an INDNO to include with the INDNO= option. If no INDNOs are specified, data for all securities in the database are retrieved. You can use this feature to obtain a list of all INDNOs in the CRSP Stock Indices (IND) database.

For example, the following statements access the IND database for monthly consumer price index data (INDNO=1000709):

   LIBNAME myLib sasexccm 'physical-name'
      SETID=420
      INDNO=1000709  /* Consumer Price Index */
      ITEMLIST=
       "MREBAL.*;MRBBEGDT.*;MRBENDDT.*;MRUSDCNT.*;MMINID.*;MMAXID.*;MMINSTAT.*";

   data mindts_all;
      set myLib.mindhdr;
      set myLib.mrebal;
   run;

When accessing CRSP US Treasury (TRS) data, you select the securities you want to access by specifying their TREASNOs. You specify a TREASNO to include with the TREASNO= option. If no TREASNOs are specified, data for all securities in the database are retrieved. You can use this feature to obtain a list of all TREASNOs in the CRSP Treasuries (TRS) database.

For example, the following statements access the TRS database for monthly ASK and BID time series data for TREASNOS 202999 and 203666:

   LIBNAME myLib sasexccm 'physical-name'
      SETID=100
      TREASNO=202999 TREASNO=203666
      ITEMLIST="TMASK.*;TMBID.*";
   data mtrsts_all;
      set myLib.trs_mth_ts;
   run;

To specify the list of data items you want to retrieve, use the ITEMLIST= option. This option accepts a string that denotes a list of interested data items and the reporting format (for example, data format, population source, consolidation level, and so on) in standard CRSP notation using CRSP’s unique mnemonic text name itm_name and the mnemonic tag keyset. For details about CRSP notation, see the section The LIBNAME libref SASEXCCM Statement under the ITEMLIST= option.

After the LIBNAME is assigned, the database is opened. The selected data are organized into groups such as ANNITEM for annual time series data or LINK for event based CRSP/Compustat link data. You can also use the SAS DATA step to perform further subsetting and to store the resulting time series in a SAS data set.

SASEXCCM supports Linux, Solaris, and 32-bit Windows.



Note: This procedure is experimental.