« HTML Ampersand Character Codes ascii | Main | OAS measure of yield »

July 14, 2005

sas proc sql joins data merging

data step merge statements corresponding to various joins.

INNER JOIN

merge data1 (in=a) data2 (in=b); by id;
if a and b;

LEFT JOIN

merge data1 (in=a) data2 (in=b); by id;
if a;

RIGHT JOIN

merge data1 (in=a) data2 (in=b); by id;
if b;

FULL JOIN
merge data1 (in=a) data2 (in=b); by id;

[ Quicktips 0206, A Visual Introduction to SQL Joins:, sql workshop at PennPop ]

Posted by omor at July 14, 2005 04:56 PM

Comments

Post a comment

! Comment registration is required but no TypeKey token has been given in weblog configuration!