Assume the dataset name is 'yourds';
Assume that the '*' meant blank in your data;
1. use Macro.
%macro tryit;
proc sql noprint;
select distinct kind into: allkind separated by ' '
from yourds;
%let nk=&sqlobs.;
quit;
data result;
set yourds;
retain lag '';
drop lag;
if not missing(cur_cell) then lag=cur_cell;
else cur_cell=lag;
run;
data result2;
set result;
by cur_cell notsorted;
array kds(&nk) $;
array rts(&nk);
drop i;
retain kds: '' rts: 0;
if first.cur_cell then do i=1 to &nk.;
kds(i)='';
rts(i)=.;
end;
select(kind);
%do j=1 %to &nk;
%let kd=%scan(&allkind,&j);
when("&kd.") do;
kds&j.=kind;
rts&j.=des_rate;
end;
%end;
otherwise;
end;
if last.cur_cell then output;
run;
ods listing close;
ods html body="c:\projects\test\test.html";
proc print data=result2 noobs;
var cur_cell %do i=1 %to &nk; kds&i rts&i %end;;
run;
ods html close;
%mend;
%tryit;
*you may want to delete the head line from the HTML file.;