title: Proc Transpose SAS: Transpose and Rename Variables
body: <p>I have a proc transpose question.  The code I have isn't quite giving me what I want.</p>
  
  <pre><code>data have;
      input name $ x y z;
  cards;
  jon 1 85 1300
  jon 2 90 2000
  jon 3 95 1800
  hal 1 70 1500
  hal 2 78 4000
  hal 3 83 3000
  ;
  run;
  
  proc sort data=have;
      by name;
  run;
  
  proc transpose data=have out=want;
      by name;
  run;
  </code></pre>
  
  <p>I want to end up with a dataset that looks like this:</p>
  
  <pre><code>name  y1  y2  y3  z1    z2    z3
  hal   70  78  83  1500  4000  3000
  jon   85  90  95  1300  2000  1800
  </code></pre>
  
  <p>The main thing here is being able to get one line per name.  Secondary is the ability to use the x variable to rename the others (y1, y2, y3, etc).  I know the first part is probably easy.  Thoughts?</p>
  
  <p>Thanks.</p>