I need to merge two files of patient data, each verified to have only one row per person. Each file contains name, SSN, and MedID, but each field contains many missings and patients that don't overlap both files. I'd like to combine like this: if SSN matches, then merge, else if MedID matches then merge, else if name matches then merge. I thought to do each step and save only the matches, but then when I combinded to three output datasets I'd have a lot of duplicate records, since some might match on more than one criteria. Is there a way to push the match flag (in=x) back to the original datasets? Then I could embark on step 2 while omitting those records already matched. I'm not new to SAS, but this really has me stumped. Greatly appreciate any help that's out there. -r
... View more