<?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 Reg:Sort in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Sort/m-p/19688#M4033</link>
    <description>i am running a dataset the sort out put is taking alphabetically &lt;BR /&gt;
data x3;&lt;BR /&gt;
input d$;&lt;BR /&gt;
cards;&lt;BR /&gt;
jan07&lt;BR /&gt;
feb07&lt;BR /&gt;
aug07&lt;BR /&gt;
aug06&lt;BR /&gt;
feb06&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=x3;&lt;BR /&gt;
by d;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
i want the output like this&lt;BR /&gt;
&lt;BR /&gt;
feb06&lt;BR /&gt;
aug06&lt;BR /&gt;
jan07&lt;BR /&gt;
feb07&lt;BR /&gt;
aug07&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
but it is comming like this &lt;BR /&gt;
aug06&lt;BR /&gt;
aug07&lt;BR /&gt;
feb06&lt;BR /&gt;
feb07&lt;BR /&gt;
jan07&lt;BR /&gt;
&lt;BR /&gt;
can u give any idea</description>
    <pubDate>Thu, 16 Apr 2009 06:41:41 GMT</pubDate>
    <dc:creator>R_Win</dc:creator>
    <dc:date>2009-04-16T06:41:41Z</dc:date>
    <item>
      <title>Reg:Sort</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Sort/m-p/19688#M4033</link>
      <description>i am running a dataset the sort out put is taking alphabetically &lt;BR /&gt;
data x3;&lt;BR /&gt;
input d$;&lt;BR /&gt;
cards;&lt;BR /&gt;
jan07&lt;BR /&gt;
feb07&lt;BR /&gt;
aug07&lt;BR /&gt;
aug06&lt;BR /&gt;
feb06&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=x3;&lt;BR /&gt;
by d;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
i want the output like this&lt;BR /&gt;
&lt;BR /&gt;
feb06&lt;BR /&gt;
aug06&lt;BR /&gt;
jan07&lt;BR /&gt;
feb07&lt;BR /&gt;
aug07&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
but it is comming like this &lt;BR /&gt;
aug06&lt;BR /&gt;
aug07&lt;BR /&gt;
feb06&lt;BR /&gt;
feb07&lt;BR /&gt;
jan07&lt;BR /&gt;
&lt;BR /&gt;
can u give any idea</description>
      <pubDate>Thu, 16 Apr 2009 06:41:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Sort/m-p/19688#M4033</guid>
      <dc:creator>R_Win</dc:creator>
      <dc:date>2009-04-16T06:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:Sort</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Sort/m-p/19689#M4034</link>
      <description>you have to change your d a character variable into a dn a numeric date&lt;BR /&gt;
like this&lt;BR /&gt;
&lt;BR /&gt;
data x3;&lt;BR /&gt;
input d $;&lt;BR /&gt;
dn=input(d,monyy5.);&lt;BR /&gt;
cards;&lt;BR /&gt;
jan07&lt;BR /&gt;
feb07&lt;BR /&gt;
aug07&lt;BR /&gt;
aug06&lt;BR /&gt;
feb06&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=x3;&lt;BR /&gt;
by dn;&lt;BR /&gt;
run;</description>
      <pubDate>Thu, 16 Apr 2009 07:52:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Sort/m-p/19689#M4034</guid>
      <dc:creator>Andre</dc:creator>
      <dc:date>2009-04-16T07:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:Sort</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Sort/m-p/19690#M4035</link>
      <description>You read your values as characters, so SAS sorts them as characters...&lt;BR /&gt;
You can import them as dates :&lt;BR /&gt;
[pre]&lt;BR /&gt;
data x3 ;&lt;BR /&gt;
  input d &lt;B&gt;ANYDTDTE10.&lt;/B&gt; ;&lt;BR /&gt;
  format d &lt;B&gt;MONYY.&lt;/B&gt; ;&lt;BR /&gt;
  cards ;&lt;BR /&gt;
    jan07&lt;BR /&gt;
    feb07&lt;BR /&gt;
    aug07&lt;BR /&gt;
    aug06&lt;BR /&gt;
    feb06&lt;BR /&gt;
run ;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data = x3 ;&lt;BR /&gt;
  by d ;&lt;BR /&gt;
run ;&lt;BR /&gt;
&lt;BR /&gt;
proc print data = x3 noObs ;&lt;BR /&gt;
  title "Ordered Dates" ;&lt;BR /&gt;
run ;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 16 Apr 2009 08:17:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Sort/m-p/19690#M4035</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-04-16T08:17:29Z</dc:date>
    </item>
  </channel>
</rss>

