<?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: Sort based on number in a string of characters in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Sort-based-on-number-in-a-string-of-characters/m-p/237430#M55351</link>
    <description>&lt;P&gt;You will need a special option in Proc Sort:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data have;
input var $10.;
cards;
Cycle 1
Cycle 11
Cycle 12
Cycle 2
Cycle 3
Cycle 4
Cycle 5
;

proc sort data=have out=want sortseq=linguistic(Numeric_Collation=ON);
by var;
run;&lt;/PRE&gt;</description>
    <pubDate>Wed, 02 Dec 2015 19:05:16 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2015-12-02T19:05:16Z</dc:date>
    <item>
      <title>Sort based on number in a string of characters</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sort-based-on-number-in-a-string-of-characters/m-p/237418#M55347</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset which has the following values for cyclename variable.:&lt;/P&gt;
&lt;P&gt;Cycle 1&lt;/P&gt;
&lt;P&gt;Cycle 2&lt;/P&gt;
&lt;P&gt;Cycle 3&lt;/P&gt;
&lt;P&gt;Cycle&amp;nbsp;4&lt;/P&gt;
&lt;P&gt;Cycle 5&lt;/P&gt;
&lt;P&gt;Cycle 11&lt;/P&gt;
&lt;P&gt;Cycle 12&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When i SORT IT BY CYCLENAME, Cycle 11 and cycle 12 come&amp;nbsp; before cycle 2,&lt;/P&gt;
&lt;P&gt;Cycle 1&lt;/P&gt;
&lt;P&gt;Cycle 11&lt;/P&gt;
&lt;P&gt;Cycle 12&lt;/P&gt;
&lt;P&gt;Cycle 2&lt;/P&gt;
&lt;P&gt;Cycle 3&lt;/P&gt;
&lt;P&gt;Cycle&amp;nbsp;4&lt;/P&gt;
&lt;P&gt;Cycle 5&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I fix this so that cycle 11 and 11 come at last?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Archana&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2015 18:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sort-based-on-number-in-a-string-of-characters/m-p/237418#M55347</guid>
      <dc:creator>ArchanaSudhir</dc:creator>
      <dc:date>2015-12-02T18:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Sort based on number in a string of characters</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sort-based-on-number-in-a-string-of-characters/m-p/237430#M55351</link>
      <description>&lt;P&gt;You will need a special option in Proc Sort:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data have;
input var $10.;
cards;
Cycle 1
Cycle 11
Cycle 12
Cycle 2
Cycle 3
Cycle 4
Cycle 5
;

proc sort data=have out=want sortseq=linguistic(Numeric_Collation=ON);
by var;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Dec 2015 19:05:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sort-based-on-number-in-a-string-of-characters/m-p/237430#M55351</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-12-02T19:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sort based on number in a string of characters</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sort-based-on-number-in-a-string-of-characters/m-p/237446#M55356</link>
      <description>&lt;P&gt;Here is another solution, although I like the proc sort option, that is new to me:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table want as&lt;BR /&gt;select *&lt;BR /&gt;from have&lt;BR /&gt;order by input(scan(var,2,' '),8.);&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2015 20:08:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sort-based-on-number-in-a-string-of-characters/m-p/237446#M55356</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-12-02T20:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sort based on number in a string of characters</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sort-based-on-number-in-a-string-of-characters/m-p/237451#M55357</link>
      <description>Thanks, it works like magic:)</description>
      <pubDate>Wed, 02 Dec 2015 20:25:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sort-based-on-number-in-a-string-of-characters/m-p/237451#M55357</guid>
      <dc:creator>ArchanaSudhir</dc:creator>
      <dc:date>2015-12-02T20:25:04Z</dc:date>
    </item>
  </channel>
</rss>

