Display 2.38Table comparing mergesof data sets using the DATAstep with joins of data
sets using PROC SQL
Location of CITY
DATA Step
PROC SQL
Either in the
weather or
demography data
set
datain_either;
merge
SMSA_subset_weather2
(in=in1)
SMSA_subset_demog2
(in=in2);
by city;
weather2_in = in1;
demog2_in = in2;
run;
procsql;
title "FULL OUTER JOIN";
select coalesce(w.city, d.city),
JanTemp,JulyTemp, Education,income
from
SMSA_subset_weather2 as w
full join
SMSA_subset_demog2 as d
on w.city=d.city;
quit;
In boththe weather
and demography
data sets
datain_both;
set in_either;
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.