Well you got the answer to the question: How to use PROC SQL on this task, that means in this case using a lot of code including harcoded variables in a case statement. The answer to your question would be: First ask the proper question. How would I use the SAS system to solve this task? And the solution is short, simple and flexible: use PROC TRANSPOSE when you need to restructure a SAS data set Example PROC TRANSPOSE code that solves your task: proc sort data=have out=sorted; by studentname; run; proc transpose data=sorted out=transposed name=studentname; id class; by studentname; run;
... View more