<?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 data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sort-data/m-p/698493#M213633</link>
    <description>&lt;P&gt;One way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by recnr;
where opr in ('XDFW', 'EDG03');
if first.recnr=0 or last.recnr=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It's probably clear to you (but not to me) whether or not you want to keep other OPR values when the RECNR contains one of the values you are looking for.&amp;nbsp; This code keeps only the two values you specified, and requires there to be more than 1 observation containing a value in the list.&lt;/P&gt;</description>
    <pubDate>Thu, 12 Nov 2020 19:22:26 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2020-11-12T19:22:26Z</dc:date>
    <item>
      <title>Sort data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sort-data/m-p/698491#M213632</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have the following dataset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;RECNR&amp;nbsp; &amp;nbsp;&lt;/STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;OPR&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;123&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XDFW&lt;/P&gt;
&lt;P&gt;123&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; EDG03&lt;/P&gt;
&lt;P&gt;1245&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XDFW&lt;/P&gt;
&lt;P&gt;1245&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; EDG03&lt;/P&gt;
&lt;P&gt;1245&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; KFE011&lt;/P&gt;
&lt;P&gt;1245&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RTF00&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I have several observations with equal RECNR but different OPR value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to keep observations with equal RECNR (e.g. 1245) that have the OPR values of EDG03 AND XDFW.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 19:12:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sort-data/m-p/698491#M213632</guid>
      <dc:creator>Mikkel_madsen</dc:creator>
      <dc:date>2020-11-12T19:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Sort data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sort-data/m-p/698493#M213633</link>
      <description>&lt;P&gt;One way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by recnr;
where opr in ('XDFW', 'EDG03');
if first.recnr=0 or last.recnr=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It's probably clear to you (but not to me) whether or not you want to keep other OPR values when the RECNR contains one of the values you are looking for.&amp;nbsp; This code keeps only the two values you specified, and requires there to be more than 1 observation containing a value in the list.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 19:22:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sort-data/m-p/698493#M213633</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-11-12T19:22:26Z</dc:date>
    </item>
  </channel>
</rss>

