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;
Ready to join fellow brilliant minds for the SAS Hackathon?
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.