Use the following PROC
SQL code to update the population information for each state in the
SQL.UNITEDSTATES table:
proc sql;
title 'UNITEDSTATES';
update sql.unitedstates as u
set population=(select population from sql.newpop as n
where u.name=n.state)
where u.name in (select state from sql.newpop);
select Name format=$17., Capital format=$15.,
Population, Area, Continent format=$13., Statehood format=date9.
from sql.unitedstates;
/* use this code to generate output so you don't
overwrite the sql.unitedstates table */
options ls=84;
proc sql outobs=10;
title 'UNITEDSTATES';
create table work.unitedstates as
select * from sql.unitedstates;
update work.unitedstates as u
set population=(select population from sql.newpop as n
where u.name=n.state)
where u.name in (select state from sql.newpop);
select Name format=$17., Capital format=$15.,
Population, Area, Continent format=$13., Statehood format=date9.
from work.unitedstates
;
SQL.UNITEDSTATES with Updated Population Data (Partial Output)