A is:
course1 course 2 course3 course4
school1: 3 2 4 1
school2: 2 1 0 3
school3: 4 6 3 2
B is
school1 course1 3
school1 course2 2
school1 course2 4
school1 course2 1
school2 course2 2
school2 course2 1
school2 course2 0
school2 course2 3
school3 course2 4
school3 course2 6
school3 course2 3
school3 course2 2
Okay in that case you can explicitly type those names or use var1--varN (double dash variable list)
data a;
input school $ course1 course2 course3 course4 ;
cards;
school1 3 2 4 1
school2 2 1 0 3
school3 4 6 3 2
;
proc transpose data=a out=b;
by school;
var course1-course4;
run;
Okay in that case you can explicitly type those names or use var1--varN (double dash variable list)
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.