crsp_stk_scd_load
This program creates secondary indices or keys for a database. It should be used any time a new subset database is created or edits are made to an existing database. CRSP supplied databases always have all secondary indices loaded. The program can create indices on multiple keys. The program automatically erases any keys previously stored in the database.
Usage
crsp_stk_scd_load inpath insetid inputwanted indexwanted [permfile]
Parameters
- inpath
- Input CRSPDB directory path. The directory where the database is stored. Standard environment names can be used such as $CRSP_DSTK or $CRSP_MSTK on UNIX, %crsp_dstk% or %crsp_mstk% on Windows.
- insetid
- Input Setid. The input database set type. Use one of: 10 if a daily stock database. 20 if a monthly stock database.
- inputwanted
- The data required to build the index.
- 1
- if only header data are needed to build index
- 3
- if header data and events data are needed to build index.
- indexwanted
- A binary flag to select the indices to build.
- 1
- PERMCO (only header needed).
- 2
- header CUSIP (only header needed).
- 4
- historical CUSIP (header and names needed).
- 8
- historical SIC (header and names needed).
- 16
- header ticker; active securities at the cut date of the file (only header needed).
- permfile (optional)
- If this parameter is supplied, it must be the name of a text file containing PERMNOs, one per line. If the parameter is not used, all securities in the database will be used to create the secondary indices. If the parameter is supplied, the indices will only be based on the securities in the permlist and other securities will be unavailable using a secondary index read.
Add numbers in this parameter to select the indices, such that the parameter value for PERMCO and Historical SIC would be 9. Use 31 to build all secondary indices or add the flags for one or more types.
Examples
Windows
To create secondary indices PERMCO and historical CUSIP in a subset monthly database previously created and stored in c:\masub\, use the command:
crsp_stk_scd_load c:\masub\ 20 3 5