<?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 only exclude ID's with subsequent unwanted observations in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-only-exclude-ID-s-with-subsequent-unwanted-observations/m-p/488669#M15242</link>
    <description>&lt;P&gt;There are a few possibilities&amp;nbsp; This one assumes your data is sorted as indicated in your sample data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;merge have have (where=(group ne "BC") in=delete_these);&lt;/P&gt;
&lt;P&gt;by id;&lt;/P&gt;
&lt;P&gt;if delete_these then delete;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There will be a message about a many-to-many merge, but the result will still be correct.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Aug 2018 18:51:32 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-08-21T18:51:32Z</dc:date>
    <item>
      <title>How to only exclude ID's with subsequent unwanted observations</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-only-exclude-ID-s-with-subsequent-unwanted-observations/m-p/488663#M15241</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted your help in the following issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data dsn;&lt;BR /&gt;input ID $1. Seq $4. Group $5.;&lt;BR /&gt;cards;&lt;BR /&gt;1 01 BC&lt;BR /&gt;1 02 BC&lt;BR /&gt;2 00 LC&lt;BR /&gt;3 01 BC&lt;BR /&gt;3 02 LC&lt;BR /&gt;4 00 BC&lt;BR /&gt;5 01 BC&lt;BR /&gt;5 02 KC&lt;BR /&gt;5 03 BC&lt;BR /&gt;5 04 KC&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to delete all the ID's which have group other than BC. Not just the row but all the rows of that&amp;nbsp;ID.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your time and Help.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 18:41:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-only-exclude-ID-s-with-subsequent-unwanted-observations/m-p/488663#M15241</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2018-08-21T18:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to only exclude ID's with subsequent unwanted observations</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-only-exclude-ID-s-with-subsequent-unwanted-observations/m-p/488669#M15242</link>
      <description>&lt;P&gt;There are a few possibilities&amp;nbsp; This one assumes your data is sorted as indicated in your sample data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;merge have have (where=(group ne "BC") in=delete_these);&lt;/P&gt;
&lt;P&gt;by id;&lt;/P&gt;
&lt;P&gt;if delete_these then delete;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There will be a message about a many-to-many merge, but the result will still be correct.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 18:51:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-only-exclude-ID-s-with-subsequent-unwanted-observations/m-p/488669#M15242</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-21T18:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to only exclude ID's with subsequent unwanted observations</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-only-exclude-ID-s-with-subsequent-unwanted-observations/m-p/488670#M15243</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dsn;
input ID $1. Seq $4. Group $5.;
cards;
1 01 BC
1 02 BC
2 00 LC
3 01 BC
3 02 LC
4 00 BC
5 01 BC
5 02 KC
5 03 BC
5 04 KC
;
run;

proc sql;
create table want as
select *
from dsn
group by id
having max(upcase(Group) ne 'BC')=0
order by id, seq;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Aug 2018 18:53:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-only-exclude-ID-s-with-subsequent-unwanted-observations/m-p/488670#M15243</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-08-21T18:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to only exclude ID's with subsequent unwanted observations</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-only-exclude-ID-s-with-subsequent-unwanted-observations/m-p/488708#M15245</link>
      <description>Thank you for your response and time. This worked too.</description>
      <pubDate>Tue, 21 Aug 2018 20:32:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-only-exclude-ID-s-with-subsequent-unwanted-observations/m-p/488708#M15245</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2018-08-21T20:32:16Z</dc:date>
    </item>
  </channel>
</rss>

