Previous Page | Next Page

The TRANSPOSE Procedure

Example 1: Performing a Simple Transposition


Procedure features:

PROC TRANSPOSE statement option:

OUT=


This example performs a default transposition and uses no subordinate statements.


Program

 Note about code
options nodate pageno=1 linesize=80 pagesize=40;
 Note about code
data score;
   input Student $9. +1 StudentID $ Section $ Test1 Test2 Final;
   datalines;
Capalleti 0545 1  94 91 87
Dubose    1252 2  51 65 91
Engles    1167 1  95 97 97
Grant     1230 2  63 75 80
Krupski   2527 2  80 76 71
Lundsford 4860 1  92 40 86
McBane    0674 1  75 78 72
;
 Note about code
proc transpose data=score out=score_transposed;
run;
 Note about code
proc print data=score_transposed noobs;
    title 'Student Test Scores in Variables';
run;

Output

 Note about figure
                        Student Test Scores in Variables                       1

         _NAME_    COL1    COL2    COL3    COL4    COL5    COL6    COL7

         Test1      94      51      95      63      80      92      75 
         Test2      91      65      97      75      76      40      78 
         Final      87      91      97      80      71      86      72 

Previous Page | Next Page | Top of Page