rewrite_crspdb

rewrite_crspdb copies a CRSPAccess database to a new directory. It can be used to convert the database between IEEE little-endian and IEEE Big-endian data formats and compress or expand storage space needed for data modules.

Usage

rewrite_crspdb inpath outpath mode fillpadwhen [fillpadfile]

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.

outpath
Output CRSPDB directory path. The directory where the new output CRSPAccess will be created. The directory must not include existing CRSPAccess data and the user must have permission and enough disk space to create the resultant database.

mode
Two letter database conversion code. Values are:

rw
copy the data as is

wx
convert data to opposite binary type, between IEEE little-endian and IEEE big-endian

fillpadwhen
Numeric code that determines whether data modules are padded to allow padding for updated data. Codes are:

Use module defaults

1  Never fill, always store as efficiently as possible

Always use module fill factors

Only fill when creating new records

4  Only fill when editing existing records

fillpadfile (optional)
Name of a text file containing fill pad factors to override defaults for individual data modules in the database. An example file that allows for approximately one year of growth can be found in a file named crspdb_modfill.dat in the CRSP_LIB directory.

Each line in the fillpadfile contains a module ID number, a fillpadwhen code, and a fillpad amount code. The fillpadwhen overrides the fillpadwhen default for the module when the fourth parameter is 0, and the fillpad amount overrides the default for the module. A positive fillpad amount is the number of bytes extra to store for each record in the module. A negative fillpad amount is interpreted as a percentage increase abovespace needed to store for each record in the module.

Examples

Windows

To convert a subset database created on Windows in little-endian and stored in c:\mysubset\ so it can be used on Sun Solaris which requires Big-endian, use the command:

rewrite_crspdb c:\mysubset\ c:\mysubsun\ wx 1

The new Big-endian subset database will be stored in c:\mysubsun\, and uses the never fill option for the fillpadwhen parameter.