sas Using Joins in SAS Right join


Example

Like left join, right join selects all the observations from the right dataset and the matched records from the left table.

PROC SQL;
CREATE TABLE C AS
SELECT A.*, B.CC_NUMBER, B.START_DATE
FROM CUSTOMER A RIGHT JOIN CC_DETAILS B
ON A.CUSTOMERID=B.CUSTOMERID
QUIT;

Dataset C contains all the values from the right table, plus matched values from the left table or missing values in the case of no match.