Sorry, could you clarify hy you do not want to use Transpose? Seeing as that procedure is specifically built to transpose data as fast and consisely as possible it makes no sense to not use it: data have; input id semester $ type $ score; id_var=catx("_",upcase(semester),"SEMESTER",upcase(type)); datalines; 1 Fall Raw 89 1 Fall Adj 92.2 1 Spring Raw 93 1 Spring Adj 95.6 2 Fall Raw 83 2 Fall Adj 85.6 2 Spring Raw 85 2 Spring Adj 87.8 ; run; proc sort data=have; by id id_var; run; proc transpose data=have out=want; by id; var score; id id_var; idlabel id_var; run;
... View more