title: SAS proc transpose and output to excel
body: <p>Another SAS question from me (I noticed these don't come up here that often...):</p>
  
  <p>I have a data set containing something like this:</p>
  
  <pre><code>Name  |  Category  |   Level  |  Score
  John  |    cat1    |     1    |    80
  John  |    cat1    |     2    |    70
  John  |    cat1    |     3    |    10
  John  |    cat2    |     1    |    60
  John  |    cat2    |     2    |    95
  John  |    cat2    |     3    |    43
  John  |    cat2    |     4    |    28
  </code></pre>
  
  <p>And the output (excel format) should look like:</p>
  
  <pre><code>      |    cat1      |    cat2       |
  name  | 1  |  2  | 3 | 1 | 2 | 3 | 4 | 
  John  | 80 | 70  |10 |60 |95 |43 |28 |
  </code></pre>
  
  <p>What I do now, is using <code>proc transpose</code> to get the data in the right order and then <code>proc export</code>to go to .xls.</p>
  
  <p>This works fine, except for one thing. I cant get the second layer of subdivision to work. So right now, before my <code>proc transpose</code> I actually concat my category and level in my dataset (eg making it '1_cat1') and then transpose on this value, giving me the following output:</p>
  
  <pre><code>name  | 1_cat1 |  2_cat1 | 3_cat1 | 1_cat2 | 2_cat2 | 3_cat2 | 4_cat2 | 
  John  |   80   |    70   |   10   |   60   |   95   |   43   |   28   |
  </code></pre>
  
  <p><strong>Is there any way to get the first, desired output ?</strong></p>