<?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 issue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sort-issue/m-p/411406#M100576</link>
    <description>&lt;P&gt;If I understand you correctly you simply want TestCase to appear&amp;nbsp;after SES and before TREX- Oil&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming I'm correct this should give you what you need&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	length test $8;
	infile datalines;
	input test;
	datalines;
SES
TREX- OII
TREX- TI
TestPros
VA-SP
run;

proc sql;
	create table want
	as select test
	from have
	order by lowcase(test);
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 08 Nov 2017 02:08:01 GMT</pubDate>
    <dc:creator>ChrisBrooks</dc:creator>
    <dc:date>2017-11-08T02:08:01Z</dc:date>
    <item>
      <title>Sort issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sort-issue/m-p/411364#M100561</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;I am not sure what to do with the sort below.&lt;/P&gt;
&lt;P&gt;I just sort by var (character) and the result is:&lt;/P&gt;
&lt;P&gt;I try to compress ( var, ". -") to eliminate these character and the sort on the variable but still doesn't help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone tell me how to move TestPros in from of the TREX?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="95"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="95"&gt;SES&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;TREX- OII&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;TREX- TI&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG&gt;TestPros&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;VA-SP&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Tue, 07 Nov 2017 20:41:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sort-issue/m-p/411364#M100561</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2017-11-07T20:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sort issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sort-issue/m-p/411371#M100565</link>
      <description>&lt;P&gt;Try the CASEFIRST option?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By default capital letters sort before lower case.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If case doesn't matter for order, but does matter for appearance, then I would consider creating a duplicate variable that is all one case and sorting by that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should also look into the Linguistic/Collating options to change the order.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, if none of those work and you need a custom order, a format is the best approach, but it's essentially manual at that point.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 20:53:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sort-issue/m-p/411371#M100565</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-07T20:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sort issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sort-issue/m-p/411389#M100571</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;A primary linguistic collation rule is to treat alphabetic characters equally regardless of case.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;proc sort data=need sortseq=linguistic(strength=primary);;&lt;BR /&gt;by val ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 23:27:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sort-issue/m-p/411389#M100571</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2017-11-07T23:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Sort issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sort-issue/m-p/411406#M100576</link>
      <description>&lt;P&gt;If I understand you correctly you simply want TestCase to appear&amp;nbsp;after SES and before TREX- Oil&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming I'm correct this should give you what you need&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	length test $8;
	infile datalines;
	input test;
	datalines;
SES
TREX- OII
TREX- TI
TestPros
VA-SP
run;

proc sql;
	create table want
	as select test
	from have
	order by lowcase(test);
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Nov 2017 02:08:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sort-issue/m-p/411406#M100576</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-11-08T02:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sort issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sort-issue/m-p/411416#M100580</link>
      <description>&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;With all kind of option, SAS should make it simpler &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 02:52:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sort-issue/m-p/411416#M100580</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2017-11-08T02:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Sort issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sort-issue/m-p/411503#M100599</link>
      <description>&lt;P&gt;Maybe the following code could get you what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	length test $8;
	infile datalines;
	input test;
	datalines;
SES
TREX- OII
TREX- TI
TestPros
VA-SP
run;

proc sql;
	create table want
	as select test
	from have
	order by compress(test, ,'ka');
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Nov 2017 12:39:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sort-issue/m-p/411503#M100599</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-11-08T12:39:33Z</dc:date>
    </item>
  </channel>
</rss>

