<?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 SORT in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SORT/m-p/803177#M316260</link>
    <description>&lt;P&gt;How to sort the variable "rating" so that the value&amp;nbsp;"AA" is first than "A"? Because my results are coming out like this:&lt;/P&gt;
&lt;P&gt;A01&lt;/P&gt;
&lt;P&gt;A02&lt;BR /&gt;A03&lt;/P&gt;
&lt;P&gt;AA01&lt;/P&gt;
&lt;P&gt;AA02&lt;BR /&gt;AA03&lt;BR /&gt;B01&lt;BR /&gt;B02&lt;BR /&gt;B03&lt;BR /&gt;C01&lt;BR /&gt;C02&lt;BR /&gt;C03&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;CODE:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;create table resul_perf as select&lt;/P&gt;
&lt;P&gt;date,&lt;/P&gt;
&lt;P&gt;rating as varl,&lt;/P&gt;
&lt;P&gt;qtde_def,&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="4"&gt;case when def = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="4" color="#08726d"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="4"&gt; then sum(qtde_def)-qtde_def end as qtde_good,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;sum(qtde_def) as qtde_total&lt;/P&gt;
&lt;P&gt;from perf&lt;/P&gt;
&lt;P&gt;group by date,varl&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="4"&gt;having def = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="4" color="#08726d"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="4"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Mar 2022 17:26:36 GMT</pubDate>
    <dc:creator>Thalitacosta</dc:creator>
    <dc:date>2022-03-21T17:26:36Z</dc:date>
    <item>
      <title>SORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SORT/m-p/803147#M316245</link>
      <description>&lt;P&gt;How to sort the variable "rating" so that the value&amp;nbsp;"AA" is first than "A"? Because my results are coming out like this:&lt;/P&gt;
&lt;P&gt;A01&lt;/P&gt;
&lt;P&gt;A02&lt;BR /&gt;A03&lt;/P&gt;
&lt;P&gt;AA01&lt;/P&gt;
&lt;P&gt;AA02&lt;BR /&gt;AA03&lt;BR /&gt;B01&lt;BR /&gt;B02&lt;BR /&gt;B03&lt;BR /&gt;C01&lt;BR /&gt;C02&lt;BR /&gt;C03&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;CODE:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;create table resul_perf as select&lt;/P&gt;
&lt;P&gt;date,&lt;/P&gt;
&lt;P&gt;varl,&lt;/P&gt;
&lt;P&gt;qtde_def,&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="4"&gt;case when def = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="4" color="#08726d"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="4"&gt; then sum(qtde_def)-qtde_def end as qtde_good,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;sum(qtde_def) as qtde_total&lt;/P&gt;
&lt;P&gt;from perf&lt;/P&gt;
&lt;P&gt;group by DATE,variavel&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="4"&gt;having def = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="4" color="#08726d"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="4"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 16:45:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SORT/m-p/803147#M316245</guid>
      <dc:creator>Thalitacosta</dc:creator>
      <dc:date>2022-03-21T16:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: SORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SORT/m-p/803149#M316246</link>
      <description>&lt;P&gt;&lt;EM&gt;rating = varl&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 16:47:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SORT/m-p/803149#M316246</guid>
      <dc:creator>Thalitacosta</dc:creator>
      <dc:date>2022-03-21T16:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: SORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SORT/m-p/803151#M316248</link>
      <description>&lt;P&gt;variável = varl&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 16:48:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SORT/m-p/803151#M316248</guid>
      <dc:creator>Thalitacosta</dc:creator>
      <dc:date>2022-03-21T16:48:28Z</dc:date>
    </item>
    <item>
      <title>SORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SORT/m-p/803177#M316260</link>
      <description>&lt;P&gt;How to sort the variable "rating" so that the value&amp;nbsp;"AA" is first than "A"? Because my results are coming out like this:&lt;/P&gt;
&lt;P&gt;A01&lt;/P&gt;
&lt;P&gt;A02&lt;BR /&gt;A03&lt;/P&gt;
&lt;P&gt;AA01&lt;/P&gt;
&lt;P&gt;AA02&lt;BR /&gt;AA03&lt;BR /&gt;B01&lt;BR /&gt;B02&lt;BR /&gt;B03&lt;BR /&gt;C01&lt;BR /&gt;C02&lt;BR /&gt;C03&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;CODE:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;create table resul_perf as select&lt;/P&gt;
&lt;P&gt;date,&lt;/P&gt;
&lt;P&gt;rating as varl,&lt;/P&gt;
&lt;P&gt;qtde_def,&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="4"&gt;case when def = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="4" color="#08726d"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="4"&gt; then sum(qtde_def)-qtde_def end as qtde_good,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;sum(qtde_def) as qtde_total&lt;/P&gt;
&lt;P&gt;from perf&lt;/P&gt;
&lt;P&gt;group by date,varl&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="4"&gt;having def = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="4" color="#08726d"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="4"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 17:26:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SORT/m-p/803177#M316260</guid>
      <dc:creator>Thalitacosta</dc:creator>
      <dc:date>2022-03-21T17:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: SORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SORT/m-p/803181#M316261</link>
      <description>&lt;P&gt;Please do not double-post.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 17:41:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SORT/m-p/803181#M316261</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-21T17:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: SORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SORT/m-p/803308#M316308</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/391297"&gt;@Thalitacosta&lt;/a&gt;&amp;nbsp;WHY do you want to sort this way?&lt;/P&gt;
&lt;P&gt;In the &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/nlsref/p1d7k16vtur7s4n1nbbaf8ro6sk7.htm#:~:text=The%20collating%20sequence%20is%20the,in%20relation%20to%20other%20characters." target="_self"&gt;collating sequence&lt;/A&gt; digits come before characters and though A0 comes before AA. This is not only with SAS the case - like copy/paste your codes into Excel and sort there. You will get the same result.&lt;/P&gt;
&lt;P&gt;I'm sure with a bit of effort some code could be written to arrange the data the way you have in mind. But why would you do that given that "nothing else" would sort the data this way.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 12:02:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SORT/m-p/803308#M316308</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-03-22T12:02:29Z</dc:date>
    </item>
  </channel>
</rss>

