<?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: How to order  several variables? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-order-several-variables/m-p/286654#M58831</link>
    <description>OK, your last sentence answer my question. Thank you.</description>
    <pubDate>Sun, 24 Jul 2016 13:07:21 GMT</pubDate>
    <dc:creator>RavenWu</dc:creator>
    <dc:date>2016-07-24T13:07:21Z</dc:date>
    <item>
      <title>How to order  several variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-order-several-variables/m-p/286645#M58823</link>
      <description>&lt;P&gt;The following is my codes, and I &amp;nbsp;want to order&lt;STRONG&gt;&amp;nbsp;id cash ticket&lt;/STRONG&gt; (low- high) and &lt;STRONG&gt;quantity&lt;/STRONG&gt; (high-low), but I found that I can't order all of&lt;/P&gt;&lt;P&gt;this variables at the same time as I want. For example, if I want to order &lt;STRONG&gt;id&lt;/STRONG&gt; from low to high, then I can't order the &lt;STRONG&gt;cash&lt;/STRONG&gt; from low to high anymore since the orders of this two variables are conflict, and that is logical.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA HAVE;
INPUT  id 4. ticket 3. quantity 3. cash 3.;

DATALINES  ; 
3000 15	1 92
3002 1 	0 86
3002 24	0 86
3009 3  5 91
;
RUN;
PROC SORT DATA=HAVE OUT=WANT;
BY id cash ticket  DESCENDING quantity;
RUN;&lt;/PRE&gt;&lt;P&gt;output:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4197iDA182C99C7C75181/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="2016-07-24_115445.png" title="2016-07-24_115445.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to confirm that Is it true that it is impossible to order several variables at the same time if their orders are conflict?&lt;/P&gt;&lt;P&gt;I am not sure, maybe there is other way that I can't&amp;nbsp;think up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jul 2016 09:59:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-order-several-variables/m-p/286645#M58823</guid>
      <dc:creator>RavenWu</dc:creator>
      <dc:date>2016-07-24T09:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to order  several variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-order-several-variables/m-p/286647#M58824</link>
      <description>I'm not sure what you are expecting? &lt;BR /&gt;What is your desired output? &lt;BR /&gt;Tables are two dimensional so you can't have several sort orders at the same time.&lt;BR /&gt;By specifying several by variables you are specifying the order of that variable within the the previous by variable value.</description>
      <pubDate>Sun, 24 Jul 2016 10:28:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-order-several-variables/m-p/286647#M58824</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-07-24T10:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to order  several variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-order-several-variables/m-p/286650#M58827</link>
      <description>&lt;P&gt;Off topic (combination SAS/R solution &amp;nbsp;-casino slot machine &amp;nbsp;like problem)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;see&lt;/P&gt;&lt;P&gt;&lt;A href="https://goo.gl/lL3Wu1" target="_blank"&gt;https://goo.gl/lL3Wu1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may be able to spin both columns independently with a SAS or WPS hash?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also probably easy with SAS/IML.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jul 2016 12:14:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-order-several-variables/m-p/286650#M58827</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2016-07-24T12:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to order  several variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-order-several-variables/m-p/286654#M58831</link>
      <description>OK, your last sentence answer my question. Thank you.</description>
      <pubDate>Sun, 24 Jul 2016 13:07:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-order-several-variables/m-p/286654#M58831</guid>
      <dc:creator>RavenWu</dc:creator>
      <dc:date>2016-07-24T13:07:21Z</dc:date>
    </item>
  </channel>
</rss>

