<?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: Order the Month in Acsending order in proc transpose in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Order-the-Month-in-Acsending-order-in-proc-transpose/m-p/780708#M248785</link>
    <description>&lt;P&gt;No. You need change it after proc transpose.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
length
  dept $25
  month_ 4
  count_ 8
  current 8
;
input dept month_ :monyy5. count_ current;
format month_ yymmd7.;
datalines;
Atlantic JAN20 1 1 
Atlantic JAN20 1 0 
Central FEB20 1 1  
Central APR20 1 1   
Central MAR20 1 0 
Pacific APR20 1 0   
Pacific FEB20 1 1
;
run;

options validvarname=any;

PROC TRANSPOSE data=have OUT=have_2 let;
BY dept;
ID month_;
VAR  count_   /*'WAIVED FEE VOLUME'n*/;
RUN;

proc sql noprint;
select distinct nliteral(put(month_,yymmd7.)) into : monthes separated by ' ' from have ;
quit;
data want;
 retain dept &amp;amp;monthes.;
set have_2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 17 Nov 2021 11:44:00 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2021-11-17T11:44:00Z</dc:date>
    <item>
      <title>Order the Month in Acsending order in proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Order-the-Month-in-Acsending-order-in-proc-transpose/m-p/780498#M248706</link>
      <description>&lt;PRE&gt;data have;
length
  dept $25
  month_ 4
  count_ 8
  current 8
;
input dept month_ :monyy5. count_ current;
format month_ yymmd7.;
datalines;
Atlantic JAN20 1 1 
Atlantic JAN20 1 0 
Central FEB20 1 1  
Central APR20 1 1   
Central MAR20 1 0 
Pacific APR20 1 0   
Pacific FEB20 1 1
;
run;

PROC TRANSPOSE data=have OUT=have_2 let;
BY dept;
ID month_;
VAR  count_   /*'WAIVED FEE VOLUME'n*/;
RUN;&lt;/PRE&gt;
&lt;P&gt;When the proc transpose runs, it produces the following&lt;/P&gt;
&lt;TABLE width="330"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="55"&gt;dept&lt;/TD&gt;
&lt;TD width="59"&gt;_NAME_&lt;/TD&gt;
&lt;TD width="54"&gt;2020-01&lt;/TD&gt;
&lt;TD width="54"&gt;2020-02&lt;/TD&gt;
&lt;TD width="54"&gt;2020-04&lt;/TD&gt;
&lt;TD width="54"&gt;2020-03&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Atlantic&lt;/TD&gt;
&lt;TD&gt;count_&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Central&lt;/TD&gt;
&lt;TD&gt;count_&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Pacific&lt;/TD&gt;
&lt;TD&gt;count_&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;How can I order the for references to Month in ascending order.&amp;nbsp; In this case the 2020-04 should be last.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 16:39:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Order-the-Month-in-Acsending-order-in-proc-transpose/m-p/780498#M248706</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2021-11-16T16:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Order the Month in Acsending order in proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Order-the-Month-in-Acsending-order-in-proc-transpose/m-p/780499#M248707</link>
      <description>&lt;P&gt;In reporting procedures, the order can be determined from the values (with options like ORDER=INTERNAL). TRANSPOSE sets the column names in the order the ID values are encountered, because in datasets column order is irrelevant (columns are found by name, not position).&lt;/P&gt;
&lt;P&gt;What do you intend to do with the wide data?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 16:53:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Order-the-Month-in-Acsending-order-in-proc-transpose/m-p/780499#M248707</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-16T16:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Order the Month in Acsending order in proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Order-the-Month-in-Acsending-order-in-proc-transpose/m-p/780516#M248719</link>
      <description>&lt;P&gt;Are you sure that you actually need a transposed data set like that? What are you doing with it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 18:10:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Order-the-Month-in-Acsending-order-in-proc-transpose/m-p/780516#M248719</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-11-16T18:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Order the Month in Acsending order in proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Order-the-Month-in-Acsending-order-in-proc-transpose/m-p/780530#M248724</link>
      <description>&lt;P&gt;I need to show the numeric month reference in ascending order as shown above.&amp;nbsp; I was given the idea to use order=internal in my proc report so I will try that&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 19:01:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Order-the-Month-in-Acsending-order-in-proc-transpose/m-p/780530#M248724</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2021-11-16T19:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Order the Month in Acsending order in proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Order-the-Month-in-Acsending-order-in-proc-transpose/m-p/780708#M248785</link>
      <description>&lt;P&gt;No. You need change it after proc transpose.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
length
  dept $25
  month_ 4
  count_ 8
  current 8
;
input dept month_ :monyy5. count_ current;
format month_ yymmd7.;
datalines;
Atlantic JAN20 1 1 
Atlantic JAN20 1 0 
Central FEB20 1 1  
Central APR20 1 1   
Central MAR20 1 0 
Pacific APR20 1 0   
Pacific FEB20 1 1
;
run;

options validvarname=any;

PROC TRANSPOSE data=have OUT=have_2 let;
BY dept;
ID month_;
VAR  count_   /*'WAIVED FEE VOLUME'n*/;
RUN;

proc sql noprint;
select distinct nliteral(put(month_,yymmd7.)) into : monthes separated by ' ' from have ;
quit;
data want;
 retain dept &amp;amp;monthes.;
set have_2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Nov 2021 11:44:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Order-the-Month-in-Acsending-order-in-proc-transpose/m-p/780708#M248785</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-11-17T11:44:00Z</dc:date>
    </item>
  </channel>
</rss>

