FIX_GHOST_PROBLEMS Custom QC utility
This utility works in two different ways:
For a single field (FIX_GHOST_PROBLEMS EGR SOURCECODE), it will eliminate ghost rows as well as duplicate values.
For an amv set (FIX_GHOST_PROBLEMS EOR TOWNRANGE SECTION MERIDIAN TRSNOTE), it will eliminate rows where the all the columns specified are null (does not get rid of duplicate rows).
This QC is not technically necessary for the HDMS Conversion, but is helpful in reducing the number of unnecessary error messages.
General procedure:
- Identify the MV field or AMV set to be checked (only fill-in fields)
- Execute FIX_GHOST_PROBLEMS {filename} {fieldname} [ {fieldname2} ...]
- If prompted, type 'FixGhostProblems' for the password. This is just a safety measure.
- When the program is finished, execute UNPROTECTED.PC EXIT CMD /C START NOTEPAD FIXGHOST.LOG
- If you are satisfied with what the program did, copy the records from the XFER file back to the original file (e.g., RECORDCOPY EGR.XFER TO:(EGR (DO)).
You can execute multiple checks on the same file before recordcopying the corrected records back to the BCD.
How the program actually works:
For a single MV field
- Works only if it is a fill-in field.
- Uses the active list (if any), otherwise it does the entire file. This means you can do a GETLIST before executing the process.
- Attempts to read the existing record from the XFER file first (to add fixes to the already fixed records); if not found, it reads the record from the BCD file.
- Looks for null values and removes them; looks for duplicate values and removes *subsequent* duplicates keeping the first one.
- Puts any corrected records in the XFER file. If a record was not corrected, it is not written to the XFER file.
For an AMV set
- Works only if the fields specified are fill-in (not symbolic).
- Uses the active list (if any), otherwise it does the entire file. This means you can do a GETLIST before executing the process.
- Attempts to read the existing record from the XFER file first (to add fixes to the already fixed records); if not found, it reads the record from the BCD file.
- Looks for null values in all columns for each row and removes them (e.g., if you execute FIX_GHOST_PROBLEMS EOR TOWNRANGE SECTION MERIDIAN TRSNOTE, it will remove any rows where all four fields are blank).
- Puts any corrected records in the XFER file. If a record was not corrected, it is not written to the XFER file.
Back to GeneralQcUtilities