Help finding missing record in sequential database dump

Help finding missing record in sequential database dump

1
NewbieNewbie
1

    Aug 10, 2006#1

    I have an indexed flatfile database (Acucobol) that I have unloaded to a text file with one 40 byte record per line (0A 0D delimited). Each record begins with an 8 byte unique key. The file is sorted on this key.
    My requirement is to read through the file and identify any missing records based on this key, and to write the resulting key to a result file.

    The unload file contains nearly 4,000,000 records of the following format:

    00000022ACCOUNT120060808010001 <- Record ends here, at column 40>

    Where a field in a record is incomplete the data is replaced with spaces (or, occasionally with nulls).

    Any help would be appreciated.
    My thoughts would be to read through the file examining the first 8 bytes to a value (beginning with 00000000), and adding 1 at each iteration. If the comparison is true continue, if false write the comparison string to the result file and continue. I currently have the latest and greatest Uedit32 installed.

    Thanks,
    Bill F

    6,675585
    Grand MasterGrand Master
    6,675585

      Aug 11, 2006#2

      Maybe an UE macro could do the job, although string compares are not possible, just find for a string.

      I hope every line of your file is terminated with 0D 0A (CRLF) and not 0A 0D (LFCR).

      But for so many records I think there is a faster method. Do following:

      1) Use Edit - Select Range command to select from line 1 to 40000000 and the columns 2 - 8.

      2) Press Ctrl+C to copy the selected columns and paste it into a new file.

      3) Save the new file with only the columns 2-8 to "Originial.txt".

      4) Save the file again with SaveAs to a different name like "Renumbered.txt".

      5) While still in column mode in Renumbered.txt select again the 7 columns and press DEL to delete it. You now should have a file with 4000000 blank lines.

      6) Back at top of the file without a selection and still in column mode click now on Column - Insert Number. Enter 0 as first number, Leading Zeros should be already checked and also Decimal selected. Press OK to renumber the lines. I have done this never on a file with so many numbers. Hope this works.

      7) Save now the renumbered file "Renumbered.txt".

      8) Reopen again "Originial.txt" and run File - Compare Files with "Originial.txt" and "Renumbered.txt". You should now see which numbers/records are missing in your source file.
      Best regards from an UC/UE/UES for Windows user from Austria