This program creates new CRSP/Compustat Merged Database from an existing database or appends records from one database to another. It can use a gvkey list 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 GVKEYs to copy to the new database.
cst_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_CST on UNIX, crsp_cst: on OpenVMS, or %crsp_cst% for Windows.
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 GVKEYs will be added to that database.
The database type. Use 200 for a Compustat database in CRSPAccess format
The database type. Input and output setids should be the same.
Set wanted. A binary flag to determine the modules that will be supported in the new database. Use 4095 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 4095 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:
1 headers, description history, link-history
2 annual period descriptors
4 quarterly period descriptors
8 annual data items
16 annual footnotes
32 quarterly data items
64 quarterly footnotes
128 bank annual items
256 bank quarterly items
512 operating segments
1024 Index Fundamental items
2048 PDE data
(optional) Permlist file. The name of a file with a list of GVKEYs, one to a line. This parameter is optional. If it is used, only the GVKEYs in the input file will have data copied to the new database. If the parameter is not used, all GVKEYs in the input database will be copied.
If a new Compustat database is created using cst_partial, crsp_cst_headall should be run to create new header and namelist files that are associated with the new database, and crsp_cst_scd_load should be run so that alternate keys are supported in cstprint.