I want to use proc print or something to display a table like this below. I have been trying to use arrays, but maybe I'm on the wrong track. aaa bbb ccc ddd eee 0 0 0 0 fff 0 1 0 0 ggg 0 1 0 0 This is my code so far which doesnt work. data want (keep=C1-C12);
array fname {4} $ 3 ('aaa', 'bbb', 'ccc', 'ddd');
array sname {3} $ 3 ('eee', 'fff', 'ggg');
array C3SP {4,3} $ 1 C1-C12;
do i = 1 to 4;
do j = 1 to 3;
if sname[j] in ('fff', 'ggg') and fname[i] = 'bbb' then myname = '1';
else myname= '0';
C3SP[i,j] = myname;
put C3SP[i,j]=;
output;
end;
end;
run;
... View more