<?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 Removing a large number of observations based on a series of patient ID's in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Removing-a-large-number-of-observations-based-on-a-series-of/m-p/376721#M276642</link>
    <description>&lt;P&gt;Hello Everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a large list of patient records (over 100k). After some initial analysis I have come up with a list of 1720 patient ID's that need to be removed from the list. Any suggestions as to how to go about this without writing the following 1720 times?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if patient_id = (patient_id) then DELETE;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts would be much appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jul 2017 19:25:28 GMT</pubDate>
    <dc:creator>righcoastmike</dc:creator>
    <dc:date>2017-07-17T19:25:28Z</dc:date>
    <item>
      <title>Removing a large number of observations based on a series of patient ID's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-a-large-number-of-observations-based-on-a-series-of/m-p/376721#M276642</link>
      <description>&lt;P&gt;Hello Everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a large list of patient records (over 100k). After some initial analysis I have come up with a list of 1720 patient ID's that need to be removed from the list. Any suggestions as to how to go about this without writing the following 1720 times?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if patient_id = (patient_id) then DELETE;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts would be much appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2017 19:25:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-a-large-number-of-observations-based-on-a-series-of/m-p/376721#M276642</guid>
      <dc:creator>righcoastmike</dc:creator>
      <dc:date>2017-07-17T19:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: Removing a large number of observations based on a series of patient ID's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-a-large-number-of-observations-based-on-a-series-of/m-p/376723#M276643</link>
      <description>&lt;P&gt;Merge the two files, but only keep those IDs which aren't in both files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2017 19:34:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-a-large-number-of-observations-based-on-a-series-of/m-p/376723#M276643</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-07-17T19:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Removing a large number of observations based on a series of patient ID's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-a-large-number-of-observations-based-on-a-series-of/m-p/376726#M276644</link>
      <description>&lt;P&gt;Art has the best idea, if the patient IDs to be removed are somehow indicated in a&amp;nbsp;SAS dataset. But you didn't say that the information was in the dataset, you said you have a list ... somehow you have to either type the patient IDs as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;if patient_id in (2300091,2300392,2407702, ...) then delete; &lt;BR /&gt;/* and don't make any typographical errors */&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or otherwise find a way to indicate these 1720 patient IDs&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2017 20:03:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-a-large-number-of-observations-based-on-a-series-of/m-p/376726#M276644</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-07-17T20:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: Removing a large number of observations based on a series of patient ID's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-a-large-number-of-observations-based-on-a-series-of/m-p/376737#M276645</link>
      <description>&lt;P&gt;Use SQL NOT IN&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming your full dataset is A and your partial dataset is B,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select *
from table a
where id not in (select id from b);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/154458"&gt;@righcoastmike&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello Everyone,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a large list of patient records (over 100k). After some initial analysis I have come up with a list of 1720 patient ID's that need to be removed from the list. Any suggestions as to how to go about this without writing the following 1720 times?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if patient_id = (patient_id) then DELETE;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any thoughts would be much appreciated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks so much&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2017 20:03:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-a-large-number-of-observations-based-on-a-series-of/m-p/376737#M276645</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-17T20:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Removing a large number of observations based on a series of patient ID's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-a-large-number-of-observations-based-on-a-series-of/m-p/376840#M276646</link>
      <description>&lt;P&gt;This worked like a charm.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For anyone looking to use this solution, you can find instructions on how to merge tables while only keeping the records that don't match here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/40/414.html" target="_blank"&gt;http://support.sas.com/kb/40/414.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rightcoast.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2017 01:58:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-a-large-number-of-observations-based-on-a-series-of/m-p/376840#M276646</guid>
      <dc:creator>righcoastmike</dc:creator>
      <dc:date>2017-07-18T01:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Removing a large number of observations based on a series of patient ID's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-a-large-number-of-observations-based-on-a-series-of/m-p/376842#M276647</link>
      <description>Luckily I had the patient ID's in both tables. I'll be more specific next time, but thanks so much. I'm sure this will come in handy down the line.</description>
      <pubDate>Tue, 18 Jul 2017 01:59:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-a-large-number-of-observations-based-on-a-series-of/m-p/376842#M276647</guid>
      <dc:creator>righcoastmike</dc:creator>
      <dc:date>2017-07-18T01:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Removing a large number of observations based on a series of patient ID's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-a-large-number-of-observations-based-on-a-series-of/m-p/376843#M276648</link>
      <description>Thankfully I didn't need to go full Proc SQL on this one. Still though, really helpful for future challenges. Thanks so much!</description>
      <pubDate>Tue, 18 Jul 2017 02:00:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-a-large-number-of-observations-based-on-a-series-of/m-p/376843#M276648</guid>
      <dc:creator>righcoastmike</dc:creator>
      <dc:date>2017-07-18T02:00:44Z</dc:date>
    </item>
  </channel>
</rss>

