Desktop productivity for business analysts and programmers

Full outer Join in SAS EG

Not applicable
Posts: 1

Full outer Join in SAS EG

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?

Posts: 1,334

Re: Full outer Join in SAS EG

Posted in reply to Abu_Fudail

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.


Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation