This program creates secondary indexes 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 indexes loaded. The program can create indexes on multiple keys. The program automatically erases any keys previously stored in the database.


crsp_stk_scd_load inpath insetid inputwanted indexwanted [permfile]


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.

Input Setid. The input database set type. Use one of: 10 if a daily stock database. 20 if a monthly stock database.

The data required to build the index.

if only header data are needed to build index

3  if header data and events data are needed to build index.

A binary flag to select the indexes to build.

1  PERMCO (only header needed).

header CUSIP (only header needed).

historical CUSIP (header and names needed).

historical SIC (header and names needed).

16  header ticker; active securities at the cut date of the file (only header needed).

Add numbers in this parameter to select the indexes, such that the parameter value for PERMCO and Historical SIC would be 9. Use 31 to build all secondary indexes or add the flags for one or more types.

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 indexes. If the parameter is supplied, the indexes will only be based on the securities in the permlist and other securities will be unavailable using a secondary index read.



To create secondary indexes 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