This Article serves as an addendum to
How to troubleshoot errors (450) and (3191) that occur when dumping or displaying recordsThis method can be used to retrieve the data from a record when the RECID is known, prior to deleting the bad record with IDXFIX.
This solution is not used to repair corruption reported by these error messages, that requires re-instating the data from other sources.This exercise is intended to provide information from the fields that can be read from the corrupted record:
- To make it easier to re-create the record if the data can be validated
- To know what data is lost when the record is deleted
Errors 450 and 3191 indicate that record has become corrupted. Before deleting the record it may be helpful to know what data is in the record.
Error 3191 provides the failing field number <field-num>, the table name <file-name> and the recid <RECID>.
With that information, the data may be retrieved up to the bad field:
If there are 10 fields in the record and the message says "Cannot read field 4 from record, not enough fields."
Then fields 1 through (field-num -1) or 3 fields can be retrieved from this record using the recid number
In the following code example, <field-name> is the name of each field to be directed to the output file <RECID>.d
// Create an input file with the RECID of each corrupted record in the table
INPUT FROM recidscust.txt.
DEFINE VARIABLE i AS RECID NO-UNDO.
REPEAT:
IMPORT i.
OUTPUT TO VALUE(STRING(i) + ".d").
FIND customer WHERE RECID(customer) = i.
IF AVAILABLE customer THEN
EXPORT DELIMITER ";" Customer.CustNum Customer.Name Customer.CreditLimit.
// EXPORT DELIMITER ";" Customer EXCEPT CustNum NAME CreditLimit Comments.
END.
OUTPUT CLOSE.