<?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, comparing between two inputs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-comparing-between-two-inputs/m-p/152445#M262594</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tried this already, but wasn't succesfull. I have to retry on Monday.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 20 Sep 2014 04:48:58 GMT</pubDate>
    <dc:creator>PaulC</dc:creator>
    <dc:date>2014-09-20T04:48:58Z</dc:date>
    <item>
      <title>proc sql, comparing between two inputs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-comparing-between-two-inputs/m-p/152443#M262592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using proc sql in data integration studio transformation "sql execute". How can I make the following work so that I can delete from the table according to the other table.&lt;/P&gt;&lt;P&gt;I have two inputs to the transformation &amp;amp;_input1. and &amp;amp;_input2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is just some simple syntax error which I do not see ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;user written code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt; delete from &amp;amp;_input2.&lt;/P&gt;&lt;P&gt; where&amp;nbsp; &amp;amp;_input2.variable = &amp;amp;_input1.variable&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot point to input one as: "&amp;amp;_input1.variable", how do I do that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 15:32:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-comparing-between-two-inputs/m-p/152443#M262592</guid>
      <dc:creator>PaulC</dc:creator>
      <dc:date>2014-09-19T15:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql, comparing between two inputs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-comparing-between-two-inputs/m-p/152444#M262593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If &amp;amp;_input1 and 2 are dataset names you need two periods to reference variables to get the dataset.variable construct&lt;/P&gt;&lt;P&gt;the first period tells the macro processor to get the value of &amp;amp;_input1 and then append the text variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where&amp;nbsp; &amp;amp;_input2&lt;STRONG&gt;..&lt;/STRONG&gt;variable = &amp;amp;_input1&lt;STRONG&gt;..&lt;/STRONG&gt;variable&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 15:40:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-comparing-between-two-inputs/m-p/152444#M262593</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-09-19T15:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql, comparing between two inputs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-comparing-between-two-inputs/m-p/152445#M262594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tried this already, but wasn't succesfull. I have to retry on Monday.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Sep 2014 04:48:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-comparing-between-two-inputs/m-p/152445#M262594</guid>
      <dc:creator>PaulC</dc:creator>
      <dc:date>2014-09-20T04:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql, comparing between two inputs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-comparing-between-two-inputs/m-p/152446#M262595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Code you could generate using the SQL Delete transformation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete from target.Class_Target&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Class_Target.Name IN (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DelRecords.Name length = 8&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; work.DelRecords as DelRecords&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below how my sample job creating above code looks like.&lt;/P&gt;&lt;P&gt;I first load sashelp.class into a target table, then have an extract step where I only select the rows "where name='Alfred' from the source table, and then a delete step deleting all records in target where name matches with the extract (so: "Alfred").&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="7460" alt="Capture.PNG" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/7460_Capture.PNG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="7461" alt="Capture.PNG" class="jive-image-thumbnail jive-image" height="144" src="https://communities.sas.com/legacyfs/online/7461_Capture.PNG" style="height: 144px; width: 531.147540983607px;" width="531" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="7462" alt="Capture.PNG" class="jive-image" src="https://communities.sas.com/legacyfs/online/7462_Capture.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="7463" alt="Capture.PNG" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/7463_Capture.PNG" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Sep 2014 10:32:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-comparing-between-two-inputs/m-p/152446#M262595</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-09-20T10:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql, comparing between two inputs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-comparing-between-two-inputs/m-p/152447#M262596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found out that this is really what i want and working:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DELETE FROM &amp;amp;_input2. as b&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE EXISTS(SELECT 1 FROM &amp;amp;_input1. as a WHERE a.variable1=b.variable1 and a.variable2=b.variable2);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 15:31:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-comparing-between-two-inputs/m-p/152447#M262596</guid>
      <dc:creator>PaulC</dc:creator>
      <dc:date>2014-09-23T15:31:04Z</dc:date>
    </item>
  </channel>
</rss>

