Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Data String Comparison

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Data String Comparison

    tracyga wrote: > I'm looking for a method to compare field values which are not an > exact "match", and determine that they are similar. For example, U.S. > Postmaster would be considered "similar" to United States Postal > Service. Our programmers are RPG/RPG ILE programmers, and have not > been able to give me any advice to accomplish this. Any ideas would > be appreciated. Tracy, What you are looking for is called a Soundex function. If you can work with SQL, the Soundex function was introduced in V4R5. If you can only use RPG, then you can see an example here: http://mcpressonline.com/mc?50@139.T...pz.1@.5bfa483c Bill

  • #2
    Data String Comparison

    Good answer Bill. Unfortunately, those 2 strings return different SoundEx() values. I think some sort of cross reference table will need to be built to replace values in strings like 'U.S.' would be replaced with 'United States'. Then SoundEx() could be used. Tracy - write down the source and target string values and give that list to the programmers. This list should be maintainable in a subfile. Chris

    Comment


    • #3
      Data String Comparison

      Comment


      • #4
        Data String Comparison

        Chris Ringer wrote: > Good answer Bill. Unfortunately, those 2 strings return different > SoundEx() values. I think some sort of cross reference table will > need to be built to replace values in strings like 'U.S.' would be > replaced with 'United States'. Then SoundEx() could be used. I was going to point the fact out that getting those two to be equivalent would be a long shot but I assumed it was just a bad example. But then, maybe it's not a bad example and then your suggestion would definitely apply. Bill

        Comment


        • #5
          Data String Comparison

          I'm looking for a method to compare field values which are not an exact "match", and determine that they are similar. For example, U.S. Postmaster would be considered "similar" to United States Postal Service. Our programmers are RPG/RPG ILE programmers, and have not been able to give me any advice to accomplish this. Any ideas would be appreciated.

          Comment


          • #6
            Data String Comparison

            I did something similair with names and addresses. I used a combination of soundex and converting common words to a standard word ie like street, st. would be converted to ST and northern, north and N. would be convert to N..etc....once you have all common words converted to a standard, then you can compare using soundex. I also compared char for char and calculated a %. If one phrase has 30 chars and the other had 32 and there was a difference of only 4 char then it could be considered similair. This was needed for miskeyed and mispelled words. I found that the soundex was not very accurate so I had to code around some specific spellings. I also used a nickname table so that STEVEN and STEVE and ROBERT and BOB would be a match. Bottom line is there's no easy method. You have to use a combination of several methods. But using these methods, I was able to identify possible misspelled words, nicknames..etc..

            Comment

            Working...
            X