MASTER FILE RECOVERY UTILITY ----------------------------------------------------------------------------- This program will attempt to recover the Master file records without using the XRF file. Before using the program it is advisable to take a DOS backup of the Master file. The program will also work on a Master backup file (extension .BKP). At the DOS prompt, call the program as follows: > MSTRCV2 You are then prompted to supply the name of the Master file to be recovered and of the corresponding XRF file as follows: MST: (reply to this prompt with the master file name, which must include the the full path and file extension, e.g. \ISIS\DATA\ABCD.MST) XRF: (reply to this prompt with the crossreference file name to be recreated, e.g. \ISIS\DATA\ABCD.XRF) Max MFN? (reply to this prompt with the highest MFN you have enetered in the data base. This number need not be precise, but it must be high enough to cover the last entered record. For example if you think that the highest record was 985 but you are not sure, you may reply to this prompt with 1000, if you are sure that the last MFN created was lower than 1000. This number is used to perform one of the consistency tests described below.) After you have responded to the three prompts described above the program begins to read the master file sequentially and assumes that the records are contiguous. For each record processed the following information is displayed: b/o MFN=n LEN=rl BWB=bb BWP=bp where: b is the current block number o is the offset in the block n is the MFN of the record rl is the record length bb is the value of MFBWB bp is the value of MFBWP The following consistency checks are then performed to determine a possible discontiguity: a. The MFN must be positive and within the specified range b. The record length must be positive, not less than 18 and not greater than the system supported maximum record length (currently 8000 bytes) c. MFBWB and MFBWP must be positive or zero. If greater than 0 then MFBWB must be less or equal to the current block number and MFBWP must not be greater than 500 If all tests are satified, the program assumes that it is handling a record and, using the current position and the record length tries to proceed to the next record. If any of the above tests fails the program will continue to scan the file sequentially until a record is found. This process is repeated until the whole file has been examined. At this point you have the option of re-initializing the control record. The program will ask confirmation as follows: OK to reset MST control record (Y/N)? (if you reply Y the master file control record is recreated by resetting NXTMFN to the highest MFN processed plus one, and NXTMFB and NXTMFP are set to point after tha last record in the file) Note that if you use a backup file (.BKP) as input, you must rename it with the correct master file extension .MST after the recovery.