Chapter Contents |
Previous |
Next |
The DATASOURCE Procedure |
CRSP data files come either in binary or character tape format, or in CRSP Access97 CDROM format.
CRSP stock data are provided in two files, a main data file containing security information and a calendar/indices file containing a list of trading dates and market information associated with those trading dates. If security data do not fit on one tape, they are split into two or more files, each one of which resides on a different self-contained tape. The calendar/indices file is on the first tape only.
The file types for CRSP stock files are constructed by concatenating CRSP with a D or M to indicate the frequency of data, followed by B,C, or I to indicate file formats. B is for host binary, C is for character, and I is for IBM binary formats. The last character in the file type indicates if you are reading the Calendar/Indices file (I), or if you are extracting the security (S) or annual data (A). For example, the file type for the daily NYSE/AMEX combined tape in IBM binary format is CRSPDIS. Its calendar/indices file can be read by CRSPDII, and its annual data can be extracted by CRSPDIA.
Starting in 1995, binary data tapes use split records (RICFAC=2) so the 1995 filetypes (CR95*) should be used for 1995 and 1996 binary data.
If you use utility routines supplied by CRSP to convert a character format file to a binary format file on a given host, then you need to use host binary file types (RIDFAC=1) to read those files in. Note that you can not do the conversion on one host and transfer and read the file on another host.
If you are using the CRSP Access97 Database, you will need to use the utility routine (stk_dump_bin) supplied by CRSP to generate the UNIX binary format of the data. You can access the UNIX (or SUN) binary data by using PROC DATASOURCE with the CRSPDUS for daily or CRSPMUS for monthly stock data. See the example on Example 10.11 later in this chapter.
For CRSP file types, the INFILE= option must be of the form
INFILE=( calfile security1 < security2 ... > )
where calfile is the fileref assigned to the calendar/indices file, and securty1 < securty2 ... > are the filerefs given to the security files, in the order in which they should be read.
Data Files | Database is stored in a single file. | |
INTERVAL= | DAY | for products DA, DR, DX, EX, NX and RA |
MONTH | for products MA, MX and MZ | |
BY variables | None | |
Series Variables | VWRETD | Value-Weighted Return (including all distributions) |
VWRETX | Value-Weighted Return (excluding dividends) | |
EWRETD | Equal-Weighted Return (including all distributions) | |
EWRETX | Equal-Weighted Return (excluding dividends) | |
TOTVAL | Total Market Value | |
TOTCNT | Total Market Count | |
USDVAL | Market Value of Securities Used | |
USDCNT | Count of Securities Used | |
SPINDX | Level of the Standard & Poor's Composite Index | |
SPRTRN | Return on the Standard & Poor's Composite Index | |
NCINDX | NASDAQ Composite Index | |
NCRTRN | NASDAQ Composite Return | |
Default KEEP List | All variables will be kept. |
Data Files | INFILE=( calfile securty1 < securty2 ... > ) | ||
INTERVAL= | DAY | ||
BY variables | CUSIP | CUSIP Identifier (character) | |
PERMNO | CRSP Permanent Number (numeric) | ||
COMPNO | NASDAQ Company Number (numeric) | ||
ISSUNO | NASDAQ Issue Number (numeric) | ||
HEXCD | Header Exchange Code (numeric) | ||
HSICCD | Header SIC Code (numeric) | ||
Sorting Order | BY CUSIP | ||
Series Variables | BIDLO | Bid or Low | |
ASKHI | Ask or High | ||
PRC | Closing Price of Bid/Ask Average | ||
VOL | Share Volume | ||
RET | Holding Period Return | ||
missing=( -66.0 = .p -77.0 = .t -88.0 = .r -99.0 = .b ) | |||
BXRET | Beta Excess Return | ||
missing=( -44.0 = . ) | |||
SXRET | Standard Deviation Excess Return | ||
missing=( -44.0 = . ) | |||
Events | NAMES | NCUSIP | Name CUSIP |
TICKER | Exchange Ticker Symbol | ||
COMNAM | Company Name | ||
SHRCLS | Share Class | ||
SHRCD | Share Code | ||
EXCHCD | Exchange Code | ||
SICCD | Standard Industrial Classification Code | ||
DIST | DISTCD | Distribution Code | |
DIVAMT | Dividend Cash Amount | ||
FACPR | Factor to Adjust Price | ||
FACSHR | Factor to Adjust Shares Outstanding | ||
DCLRDT | Declaration Date | ||
RCRDDT | Record Date | ||
PAYDT | Payment Date | ||
SHARES | SHROUT | Number of Shares Outstanding | |
SHRFLG | Share Flag | ||
DELIST | DLSTCD | Delisting Code | |
NWPERM | New CRSP Permanent Number | ||
NEXTDT | Date of Next Available Information | ||
DLBID | Delisting Bid | ||
DLASK | Delisting Ask | ||
DLPRC | Delisting Price | ||
DLVOL | Delisting Volume | ||
missing=( -99 = . ) | |||
DLRET | Delisting Return | ||
missing=( -55.0=.s -66.0=.t -88.0=.a -99.0=.p ); | |||
NASDIN | TRTSCD | Traits Code | |
NMSIND | National Market System Indicator | ||
MMCNT | Market Maker Count | ||
NSDINX | NASD Index | ||
Default KEEP Lists | All periodic series variables will be output to the OUT= data set and all event variables will be output to the OUTEVENT= data set. |
Data Files | INFILE=( calfile securty1 < securty2 ... > ) | ||
INTERVAL= | MONTH | ||
BY variables | CUSIP | CUSIP Identifier (character) | |
PERMNO | CRSP Permanent Number (numeric) | ||
COMPNO | NASDAQ Company Number (numeric) | ||
ISSUNO | NASDAQ Issue Number (numeric) | ||
HEXCD | Header Exchange Code (numeric) | ||
HSICCD | Header SIC Code (numeric) | ||
Sorting Order | BY CUSIP | ||
Series Variables | BIDLO | Bid or Low | |
ASKHI | Ask or High | ||
PRC | Closing Price of Bid/Ask average | ||
VOL | Share Volume | ||
RET | Holding Period Return | ||
missing=( -66.0 = .p -77.0 = .t -88.0 = .r -99.0 = .b ); | |||
RETX | Return Without Dividends | ||
missing=( -44.0 = . ) | |||
PRC2 | Secondary Price | ||
missing=( -44.0 = . ) | |||
Events | NAMES | NCUSIP | Name CUSIP |
TICKER | Exchange Ticker Symbol | ||
COMNAM | Company Name | ||
SHRCLS | Share Class | ||
SHRCD | Share Code | ||
EXCHCD | Exchange Code | ||
SICCD | Standard Industrial Classification Code | ||
DIST | DISTCD | Distribution Code | |
DIVAMT | Dividend Cash Amount | ||
FACPR | Factor to Adjust Price | ||
FACSHR | Factor to Adjust Shares Outstanding | ||
EXDT | Ex-distribution Date | ||
RCRDDT | Record Date | ||
PAYDT | Payment Date | ||
SHARES | SHROUT | Number of Shares Outstanding | |
SHRFLG | Share Flag | ||
DELIST | DLSTCD | Delisting Code | |
NWPERM | New CRSP Permanent Number | ||
NEXTDT | Date of Next Available Information | ||
DLBID | Delisting Bid | ||
DLASK | Delisting Ask | ||
DLPRC | Delisting Price | ||
DLVOL | Delisting Volume | ||
DLRET | Delisting Return | ||
missing=( -55.0=.s -66.0=.t -88.0=.a -99.0=.p ); | |||
NASDIN | TRTSCD | Traits Code | |
NMSIND | National Market System Indicator | ||
MMCNT | Market Maker Count | ||
NSDINX | NASD Index | ||
Default KEEP Lists | All periodic series variables will be output to the OUT= data set and all event variables will be output to the OUTEVENT= data set. |
Data Files | INFILE=( securty1 < securty2 ... > ) | |
INTERVAL= | YEAR | |
BY variables | CUSIP | CUSIP Identifier (character) |
PERMNO | CRSP Permanent Number (numeric) | |
COMPNO | NASDAQ Company Number (numeric) | |
ISSUNO | NASDAQ Issue Number (numeric) | |
HEXCD | Header Exchange Code (numeric) | |
HSICCD | Header SIC Code (numeric) | |
Sorting Order | BY CUSIP | |
Series Variables | CAPV | Year End Capitalization |
SDEVV | Annual Standard Deviation | |
missing=( -99.0 = . ) | ||
BETAV | Annual Beta | |
missing=( -99.0 = . ) | ||
CAPN | Year End Capitalization Portfolio Assignment | |
SDEVN | Standard Deviation Portfolio Assignment | |
BETAN | Beta Portfolio Assignment | |
Default KEEP Lists | All variables will be kept. |
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.