<?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: Problem with Sorting in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Sorting/m-p/192849#M48409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, retain priority (typo&amp;gt;??), in a datastep, so that it appears on each row (if you don't want to keep it then new variable).&amp;nbsp; Then sort by priority and 30 min:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain all_priority;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _n_=1 or priority ne . then all_priority=priority;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by all_priority 30_min;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Dec 2014 12:49:55 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2014-12-03T12:49:55Z</dc:date>
    <item>
      <title>Problem with Sorting</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Sorting/m-p/192848#M48408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;Hello&lt;/SPAN&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;I have&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;a little problem with&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;sorting&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;I have&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;tables with&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;time&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;series&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;and&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;piority&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;as&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;shown below&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" src="https://communities.sas.com/legacyfs/online/8172_pastedImage_3.png" style="width: 444px; height: 498px;" /&gt;&lt;SPAN id="result_box" lang="en"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;and I would&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;sort it&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;in the following way&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;Somehow&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;it is&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;in&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;sas&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;Thank you&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;for your help.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 12:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Sorting/m-p/192848#M48408</guid>
      <dc:creator>makset</dc:creator>
      <dc:date>2014-12-03T12:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Sorting</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Sorting/m-p/192849#M48409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, retain priority (typo&amp;gt;??), in a datastep, so that it appears on each row (if you don't want to keep it then new variable).&amp;nbsp; Then sort by priority and 30 min:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain all_priority;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _n_=1 or priority ne . then all_priority=priority;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by all_priority 30_min;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 12:49:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Sorting/m-p/192849#M48409</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-12-03T12:49:55Z</dc:date>
    </item>
  </channel>
</rss>

