<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: proc transpose in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-transpose/m-p/24925#M5622</link>
    <description>and the proc transpose code that you used was ...</description>
    <pubDate>Thu, 03 Dec 2009 14:33:29 GMT</pubDate>
    <dc:creator>Bill</dc:creator>
    <dc:date>2009-12-03T14:33:29Z</dc:date>
    <item>
      <title>proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-transpose/m-p/24924#M5621</link>
      <description>I'm having some difficulty with a proc transpose.&lt;BR /&gt;
&lt;BR /&gt;
I want the id field to appear in my new output dataset in ascending order.&lt;BR /&gt;
&lt;BR /&gt;
i.e.&lt;BR /&gt;
&lt;BR /&gt;
accno  year    variable&lt;BR /&gt;
&lt;BR /&gt;
123     2007    10&lt;BR /&gt;
123     2006    20&lt;BR /&gt;
124     2007    30&lt;BR /&gt;
124     2005    10&lt;BR /&gt;
124     2006    20&lt;BR /&gt;
&lt;BR /&gt;
and I want to transpose it to:&lt;BR /&gt;
 &lt;BR /&gt;
         2005    2006   2007&lt;BR /&gt;
123               20      10&lt;BR /&gt;
124    10        20      30&lt;BR /&gt;
&lt;BR /&gt;
but the transpose is putting the columns in a different order.  Is there an easy way to sort this without me creating new datastep/sql to re-order the columns post-creation?&lt;BR /&gt;
&lt;BR /&gt;
ta</description>
      <pubDate>Thu, 03 Dec 2009 12:02:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-transpose/m-p/24924#M5621</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-12-03T12:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-transpose/m-p/24925#M5622</link>
      <description>and the proc transpose code that you used was ...</description>
      <pubDate>Thu, 03 Dec 2009 14:33:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-transpose/m-p/24925#M5622</guid>
      <dc:creator>Bill</dc:creator>
      <dc:date>2009-12-03T14:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-transpose/m-p/24926#M5623</link>
      <description>SAS assigns transposed column names as the data is encountered.  So you must sort your input data in the desired sequence ahead of the PROC TRANSPOSE execution -- however since you must use a BY statement with your PROC TRANSPOSE code, then you must also coded the NOSORTED option on the BY statement with PROC TRANSPOSE so that SAS will not complain that the data is not in sorted order (based on the BY variable list).&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 03 Dec 2009 14:55:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-transpose/m-p/24926#M5623</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-12-03T14:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-transpose/m-p/24927#M5624</link>
      <description>After running a test and reading the DOC, I now see that coding the NOTSORTED option with the sample data sorted by YEAR will result in multiple observations for the BY statement variable list since related observations are not contiguous.&lt;BR /&gt;
&lt;BR /&gt;
As we have discussed previously, why do you need to have the variables (stored internally) in numeric sequence?&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 03 Dec 2009 15:00:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-transpose/m-p/24927#M5624</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-12-03T15:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-transpose/m-p/24928#M5625</link>
      <description>SAS creates the columns in the order they are encountered.  Since you have no obs for 2005 for the first accno it will be created last.  You could create an obs with variable = . for 2005 then sort prior to execution.  &lt;BR /&gt;
&lt;BR /&gt;
Easier is to simply specify the order to display the columns and not worry about the internal order.</description>
      <pubDate>Thu, 03 Dec 2009 15:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-transpose/m-p/24928#M5625</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-12-03T15:10:31Z</dc:date>
    </item>
  </channel>
</rss>

