Like a file rebuild operation, a file compact operation may fail for various reasons. When a file compact operation fails, check the return code of the FairCom DB API function used to compact the file and consult the FairCom DB Function Reference Guide entry for that function to determine the appropriate action.
The ctcmpcif utility can be used to compact a file that contains a valid IFIL resource. The utility opens the data file and retrieves the IFIL resource from the file. If the utility cannot read the IFIL resource, it prompts for the name of a file containing a good copy of the IFIL resource. Consider saving a copy of the file containing the IFIL resource for use in such a situation.
The ctcmpcif utility and FairCom DB compact API functions support an option to handle the presence of illegal duplicate keys by marking records containing duplicate key values as deleted.
If a file compact fails and no solution is found which allows the compact to complete successfully, re-create the file and reload the data from an external source if available, or restore a backup copy of the file.