crsp_stk_headall

Description

crsp_stk_headall allows the user to create a header file with user specified options. It is useful primarily for a sub set database, or to compact a name history list. If the files are created in the same directory as the database, and the CRSP_MSTK or CRSP_DSTK environment points to the database, the search utilities will function with that database.

File options include:

  • Recreation of standard header file for use with subset databases.
  • SIC Codes included in output with YY dates formatted for an 80-character row.
  • SIC Codes included in output with YYYY dates exceeding an 80-character row.
  • A historical security list containing identification information available in the stk_print /n option. (pipe-delimited fields include: PERMNO, PERMCO, CUSIP, Company Name, Ticker Symbol, Exchange Code, Share Code, SIC Code, Begin Date of Name Record, End Date of Name Record. This option exceeds 80-characters.
  • A historical security list containing identification information in a fixed-width file format as follows: PERMNO, PERMCO CUSIP, Company Name, Ticker Symbol, Share Class, Trading Ticker Symbol, Exchange Code, Primary Exchange, Security Status, Trading Status, Share Code, SIC Code, NAICS, Begin-End Date Range for record. This option exceeds 80-characters.

Parameters are an input database and setid, and four output files. The output files include header information, name history information, header PERMNO/CUSIP cross-reference, and historical PERMNO/CUSIP cross-reference.

Usage

crsp_stk_headall inpath insetid histfile headerfile permcusiphistfile permcusipfile [date/sic or namelist/new_namelist]

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

histfile
A file name for the name history header file. A file with this name will be created with one line per name history event for each PERMNO. Each line contains PERMNO, PERMCO, name CUSIP, company name, ticker, exchange code, SIC code, and effective range of that name information. Options include:

  • filename.ext
  • none*

If the file is named headfile.dat in the database directory, the dstksearch or mstksearch utility can be used to search this file to find identifiers. Additional output specifications for histfile may be selected with the optional namelist*/new_namelist* options described below.

headerfile
A file name for the name header file. A file with this name will be created with one line per PERMNO. Each line contains PERMNO, PERMCO, CUSIP - Header, latest company name, latest ticker, latest exchange code, latest SIC code, and date range. Options include:

  • filename.ext
  • none*

permcusiphistfile
A file name for a PERMNO/CUSIP historical cross-reference file. A file with this name will be created containing a row with CUSIP and PERMNO for every unique historical CUSIP assignment in the CRSP name history in the database. Options include:

  • filename.ext
  • none*

permcusipfile
A file name for a PERMNO/CUSIP header file. A file with this name will be created containing a row with header CUSIP and PERMNO for every security in the database. Options include:

  • filename.ext
  • none*

date or sic (optional)
The date option enables you to output the dates with years in YY format rather than YYYY.YY results in an 80-character row with two-digit years.The SIC code is not included in the default histfile option. To include the SIC Code in the output, the windows will exceed 80 characers. 132 results in a row wider than 80-characters, retaining both SIC code and four-digit years in the output.If crsp_stk_headall is run without the 132 optional parameter, it will not contain SIC Codes. These options do not work with the namelist/new_namelist options described below.

namelist or new_namelist (optional)
namelist* and new_namelist* options are parameters that further specify the output of the histfile option described above. Only one of these options can be run at one time. Note that these options don’t work with the optional date/sic output specification described above.

namelist can be used to create a compacted security list containing PERMNO, PERMCO, CUSIP, Company Name, Ticker Symbol, Exchange Code, Share Code, SIC Code, Begin Date of Name Record, End Date of Name Record.) This option exceeds a 80-characters.

When the namelist file is included in the parameters, and the command string is followed by an n, the compacted file will be produced.

namelist_new can be used to create an historical security list containing identification information containing PERMNO, PERMCO CUSIP, Company Name, Ticker Symbol, Share Class, Trading Ticker Symbol, Exchange Code, Primary Exchange, Security Status, Trading Status, Share Code, SIC Code, NAICS. This option exceeds a 80-characters.

When the namelist file is included in the parameters, and the command string is followed by an 132n, the compacted file will be produced.

Examples

Windows

To create name history header file, headfile.dat and header file, cheadfile.dat with cross-reference files permcusip.dat and cpermcusip.dat with both the SIC code and dates in four-digit years using a daily subset database in c:\mydir\, use the command (all on one line):

crsp_stk_headall c:\mydir\ 10 c:\mydir\headfile.dat
c:\mydir\cheadfile.dat c:\mydir\permcusip.dat c:\mydir\cpermcusip.dat 132