Hi, I have two data files. Each one has an ID variable, var1-var7 (which are the same variables on each file), and then the first file has some additional variables not found on the other file. The ID variable is unique on both files, BUT on File1 can sometimes be missing. Some of the IDs match across files, but there are also IDs that are unique to each. If the ID is missing, var1 - var7 will be missing, but other vars can be populated. If the IDs match across both files, var1-var7 will only be populated on File2. FILE1 ID var1 var2 var3....var7 other_vars... 1 xyz 2 d e f xyz . xyz FILE2 ID var1 var2 var3....var7 1 a b c d 3 a b c d What I want is to combine the files such that: 1. All records from File1 and File2 are kept (even those with no ID) 2. If a record is in both files, the var1-var7 values come from File2 3. If a record is just in File1 or just in File2, all values should remain intact for all variables. I considered using UPDATE to update File1 using File2 (as the update process is essentially what I want to do), but the missing ID variables seemed to be problematic when I tried. I also tried using a data step merge and then a PROC SQL join, but in both of those cases, either the File1-only or File2-only values were being overwritten.
... View more