To fix the data corruption, delete and re-create if possible each corrupt record. To obtain as much information as possible from each corrupt record, dump each field with the following steps.
Back up the database before proceeding with these steps.1) Record all recid values from error 3191.
2) Use the following code to find out the field name referenced by <field-num> in error 450 or 3191.
FIND _file WHERE _file-num = "<table-num>".
FOR EACH _field OF _file where _field-rpos = <field-num-value>:
DISP _file._file-name _field._field-name.
END.
3) For each recid use the following code to export the fields that are not corrupted by changing the <field-name> found in the step 2 .
OUTPUT TO VALUE(string(<recid>) + ".txt").
FIND <table-name> WHERE RECID(<table-name>) = <recid>.
EXPORT <table-name> EXCEPT <field-name>.
4) Delete the bad records using the command:
proutil dbname -C idxfix
A menu will be presented. Select menu item 6, "Delete one record and its index entries". Type the recid to delete and the area for the recid(s) when prompted. Repeat for each recid that is corrupt.
5) Use dbrpr with options 1, 3, 4, 7 and 8 from option 1. Database Scan menu to reformat the bad blocks and rebuild RM and Free chains.
6) Once this is complete, proceed to re-create your records using the data obtained in step 3. For the fields that were corrupted, it may be desirable to look for their values in a historic database.