Previous Page | Next Page

The TRANSPOSE Procedure

Example 3: Labeling Transposed Variables


Procedure features:

PROC TRANSPOSE statement option:

PREFIX=

IDLABEL statement

Data set: SCORE

This example uses the values of the variable in the IDLABEL statement to label transposed variables.


Program 1

 Note about code
options nodate pageno=1 linesize=80 pagesize=40;
 Note about code
proc transpose data=score out=idlabel name=Test
     prefix=sn;
   id studentid;
 Note about code
     idlabel student;
run;
 Note about code
  proc print data=idlabel label noobs;
     title 'Student Test Scores';
  run;
 Note about code
proc contents data=idlabel;
run;

Output 1

 Note about figure
                              Student Test Scores                              1

 NAME OF
  FORMER
 VARIABLE   Capalleti   Dubose   Engles   Grant   Krupski   Lundsford   McBane

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

Program 2

 Note about code
proc contents data=idlabel;
run;

Ouput 2

 Note about figure
Student Test Scores                                      2

                             The CONTENTS Procedure

                  Alphabetic List of Variables and Attributes

            #    Variable    Type    Len    Label

            1    Test        Char      8    NAME OF FORMER VARIABLE
            2    sn0545      Num       8    Capalleti
            8    sn0674      Num       8    McBane
            4    sn1167      Num       8    Engles
            5    sn1230      Num       8    Grant
            3    sn1252      Num       8    Dubose
            6    sn2527      Num       8    Krupski
            7    sn4860      Num       8    Lundsford

Previous Page | Next Page | Top of Page