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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.