<?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: Proc SQL Delete, using a join in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Delete-using-a-join/m-p/109899#M22812</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you doing this on a sql server database, or are you trying to do it on a sas dataset?&amp;nbsp; Because there are multiple ways to do it and each ahs its own benefits and downsides.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Oh, if you are trying to do it on a sas dataset, the method above is the way I have done it in the past (with a slight modification).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc SQL;&lt;/P&gt;&lt;P&gt;delete&lt;/P&gt;&lt;P&gt;from sample1 ss1&lt;/P&gt;&lt;P&gt;where ss1.id_src in (select id_src from Sample2);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've never actually tried this on a multi key delete however.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're doing this on a rbms database (like sql server) or the like, it's actually far more efficient to use a sql pass through function, Let me know if you need help on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Aug 2013 22:24:29 GMT</pubDate>
    <dc:creator>Anotherdream</dc:creator>
    <dc:date>2013-08-13T22:24:29Z</dc:date>
    <item>
      <title>Proc SQL Delete, using a join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Delete-using-a-join/m-p/109897#M22810</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;In T-SQL I think I could write something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc SQL;&lt;/P&gt;&lt;P&gt;delete a.*&lt;/P&gt;&lt;P&gt;from sample1 a inner join sample2 b&lt;/P&gt;&lt;P&gt;on a.id_src = b.id_src;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I basically want to remove records from one table that appear in the other. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2013 20:32:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Delete-using-a-join/m-p/109897#M22810</guid>
      <dc:creator>rwnj</dc:creator>
      <dc:date>2013-08-13T20:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Delete, using a join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Delete-using-a-join/m-p/109898#M22811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something along the line of the following may work for you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select * from sample1 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&amp;nbsp; id_src not in (select id_src from sample2);&lt;/P&gt;&lt;P&gt;quit; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2013 21:20:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Delete-using-a-join/m-p/109898#M22811</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-08-13T21:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Delete, using a join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Delete-using-a-join/m-p/109899#M22812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you doing this on a sql server database, or are you trying to do it on a sas dataset?&amp;nbsp; Because there are multiple ways to do it and each ahs its own benefits and downsides.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Oh, if you are trying to do it on a sas dataset, the method above is the way I have done it in the past (with a slight modification).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc SQL;&lt;/P&gt;&lt;P&gt;delete&lt;/P&gt;&lt;P&gt;from sample1 ss1&lt;/P&gt;&lt;P&gt;where ss1.id_src in (select id_src from Sample2);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've never actually tried this on a multi key delete however.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're doing this on a rbms database (like sql server) or the like, it's actually far more efficient to use a sql pass through function, Let me know if you need help on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2013 22:24:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Delete-using-a-join/m-p/109899#M22812</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-08-13T22:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Delete, using a join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Delete-using-a-join/m-p/109900#M22813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this essentially the same question as &lt;A _jive_internal="true" href="https://communities.sas.com/message/177458#177458"&gt;https://communities.sas.com/message/177458#177458&lt;/A&gt;?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2013 23:15:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Delete-using-a-join/m-p/109900#M22813</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2013-08-13T23:15:36Z</dc:date>
    </item>
  </channel>
</rss>

