data have;
input Type:$20. Car:$20.;
datalines;
Sedan Verna
Sedan HondaCity
Sedan Altis
SUV Fortuner
SUV Scorpio
Hatchback Santro
Hatchback Micra
;
run;
data want;
do _n_=1 by 1 until(last.type);
set have;
by type notsorted;
array t(999) $32 _temporary_;
t(_n_)=car;
end;
length cars $100;
cars=catx(',',of t(*));
call missing(of t(*));
drop car;
run;
... View more