Problem:
Can an empty idx file be used for rebuilding a C-ISAM file with a new key structure instead of specifying every key on the rebuild command line with the -k option?
Creating a new idx file, copying it to the data file, and rebuilding the C-ISAM data file by one of the following commands
o rebuild infile
o rebuild infile, outfile
result in a message like "records read = 0"
Resolution:
The Micro Focus C-ISAM file handler will by default use the logical end of file marker obtained from the index file header to determine the maximum number of records to process in the data file. If the index file is corrupted or a mismatching index file is overlaid for a given data file, using Rebuild with default behaviour will not recover all the records in the data file but only those specified by the logical end of file marker.
Rebuild now contains functionality that when enabled will process all the records (via a data scrape) within the data file by overriding the logical end of file maker (will use the physical end of the data file).
Example usage:
The new option is /d:c, which only is valid for CISAM files and will attempt to recover all valid records from the data file via a data scrape to the physical end. Below are two examples of its usage.
o rebuild infile /d:c
o rebuild infile, outfile /d:c
Additional Notes:
WARNING: Using a 3rd party C-ISAM file handler in conjunction with this new Rebuild functionality, may result in the recovery of deleted records within the data file.
----------------------
Available in Server Express 5.0 and Net Express 5.0
For the version 4.0, please check the rebuild command, whether or not it offers the -d[:c] option and please update Server Express or Net Express, if [:c] is not available.
----------------------
The attached example can be used to demonstrate it.
compile and run the demo will result in 4 files, on Unix:
empty.dat.idx
empty.dat
full.dat.idx
full.dat
now copy empty.dat.idx to full.dat.idx
then the rebuild can be done by the above mentioned commands
Attachments:
#RMCOBOL
#AcuCobol
#ServerExpress
#COBOL
#netexpress
