This program creates a new CRSPAccess CRSPDB stock database from an existing database or appends securities from one database to another. It can use a permlist or a data type restriction to subset the original database. It takes parameters on input and output databases, input and output set types, data wanted in the new database, and optionally a file containing PERMNOs to copy to the new database.
stk_partial inpath outpath insetid outsetid setwanted datawanted [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.
- Output CRSPDB directory path. The directory where the new database will be stored. This can be an empty directory or an existing directory. If it is an empty directory, a new database will be created. If there is already a CRSPDB in that directory, the selected PERMNOs will be added to that database.
- Input Setid. The input database set type. Use one of:
- if a daily stock database
- if a monthly stock database
- Output Setid. The output database set type. Input and output index setids should be the same.
- Set wanted. A binary flag to determine the modules that will be supported in the new database. Use 32767 to support all current modules. A module that is not loaded at this time cannot be added later to that database.
- Data wanted. A binary flag to determine which modules will be copied
to the new database. Use 32767 to copy all data to the new database.
Data wanted must be a subset of set wanted. Individual wanted codes
can be summed to load multiple modules. Individual modules codes are:
- events (names, distributions, shares, delists, NASDAQ info)
- total returns
- NASDAQ bids
- NASDAQ asks
- Returns without dividends
- NASDAQ number of trades or alternate price dates
- alternate prices or open prices
- (optional) The name of a file with a list of PERMNOs, one to a line. This parameter is optional. If it is used, only the PERMNOs in the input file will have data copied to the new database. If the parameter is not used, all PERMNOs in the input database will be copied.
If a file with PERMNOs of interest is available in the file, perm.inp, stk_partial can be run at the command prompt to create a subset monthly database in the folder c:\masub\ with the command:
stk_partial %crsp_mstk% c:\masub\ 20 20 32767 32767 perms.inp
If you change the CRSP_MSTK environment variable to point to C:\masub\, ts_print and mstkprint can be used to access this new database.