proc sql;
create table want as
select FirmID, Year, Variable1 as Variable1_2
from
(select * from have1
union all
select * from have2)
order by firmid,year;
quit;
data want ;
set have1(rename=(variable1=variable1_2))
have2(rename=(variable2=variable1_2))
;
run;
If the data was already sorted by FIRMID YEAR you can add a BY statement and the result will still be sorted.
data want ;
set have1(rename=(variable1=variable1_2))
have2(rename=(variable2=variable1_2))
;
by firmid year ;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Registration is open
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss. Register now and lock in 2025 pricing—just $495!