06-29-2014 03:39 AM
When I join 2 tables in SAS EG using full outer join and include the primary key from the first table in the output, I see missing values in some places because the record for this row exist only in 2nd table and not in 1st table. How to get the primary key from 2nd table to reflect instead of missing value?
06-29-2014 09:58 AM
I suggest that you don't do that, as the fact that the key value is missing is the indication that the record only contains data from one table, not both.
However, it is easy to create an expression to create a new variable to do exactly that. I tried it with the SASHELP.CLASS dataset, and when I create a new variable whose value is
(coalesce(t1.Name, t2.Name)) AS CombinedKey
it contains the complete set of keys.