data i;
input
ID Year Name $;
datalines;
1 1990 Bob
1 1991 Ken
1 1997 Cindy
1 1998 Will
2 1990 Jack
2 1991 Frank
2 1992 Mindy
run;
proc sort data=i;
by id year;
run;
proc sql;
create table
temp as
select
id,year
from (select distinct id from
i),(select distinct
year from i)
order by id,year;
quit;
data _temp;
merge i temp;
by id year;
run;
proc transpose data=_temp out=result(drop=_name_) prefix=_;
by id;
id year;
var name;
run;
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.