SAS: Transpose data scripts
2005-05-07    Zhang, Z.   
Print from: Zhiyong Zhang \'s Psychometric Website
Address: http://www.psychstat.org/us/article.php/9
SAS: Transpose data scripts

/************************************************************/
/* Transpose data with proc iml                                                                      */
/* By Johnny  Zhang                                                                                        */
/* July 12, 2004                                                                                               */
/************************************************************/
data temp;
infile "C:\PROGRAM\datt.dat";
input
#1 pno vno t1-t26
#2 t27-t52
#3 t53-t78
#4 t79-t103;
run;

proc sort data=temp;
by pno;
run;

proc iml;
use temp;
start;
read all var _num_ into x;
y=t(x);
print y;
create temp1 from y;
append from y;
finish;
run;
quit;
/*
proc print data=temp1;
run;
*/
data temp2;
set temp1;
file "C:\PROGRAM\data.dat";
put col1-col30;
run;

Editor: johnny