Interesting. Clearly a 1-to-1 match is out, case issues aside.
Looks like multiple keys are needed. You need to create separate string variables in file2 that are the same as those in file1, and like file1 they have to be the same "things": street_number, street, city, state, zip, etc.
I guess I'd try breaking up the file 2 addresses into those variables using (CHAR) SUBSTR and INDEX. I'm not sure what to break them up by; not spaces, maybe commas. I can't know without looking at a lot of the addresses. Obviously, there may be parts of the file 2 address that you won't be able to use; that "The Apartments at Chicago Land" part of file2 address will have no match in file1, at least for this case.
------------------------------
Rick Marcantonio
Quality Assurance
IBM
------------------------------
Original Message:
Sent: Mon March 14, 2022 01:13 PM
From: Art Jack
Subject: Address Matching
Below is sort of example. In one it's standard with parsed fields & concat. The second file is one field but formatting is not standard.
file_1_address | file_1A | file_1b | file_1c | file_1d | file_1e | file_2_address |
123 Main Dr, 265, 37244 | 123 | Main | Dr | 265 | 37244 | The Apartments at Chicago Land, 123 Main DR, APT 265 |
------------------------------
Art Jack
Original Message:
Sent: Mon March 14, 2022 12:37 PM
From: Rick Marcantonio
Subject: Address Matching
Hi. So in one file you have one variable, ADDRESS, that has something like: "123 Main Street Chicago IL 60014" and in the other you have maybe 4 fields, for example, "123 Main Street" "Chicago" , "IL", "60014"?
If so, then my advice would be in the 2nd file, use CONCAT to create a new string variable named ADDRESS with a consistent format (the A width of the string in the first file), then MATCH the files on that key. If case is a problem, then in both files, create a new key variable based on ADDRESS that is in all lower or upper case.
------------------------------
Rick Marcantonio
Quality Assurance
IBM
Original Message:
Sent: Mon March 14, 2022 12:28 PM
From: Art Jack
Subject: Address Matching
Morning,
I have two files that I need to match on address. One file has address in one field with varying degrees of format. The second file has both parsed out and single fields with a pretty standard format. I'm trying to figure out what would be an efficient way to merge the two. Thanks Arthur.
------------------------------
Art Jack
------------------------------
#SPSSStatistics