<?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: SQL MERGE USING MACRO FOR MULTIPLE VARIABLES in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SQL-MERGE-USING-MACRO-FOR-MULTIPLE-VARIABLES/m-p/411800#M279711</link>
    <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;: Thanks for your reply. But could you please elaborate on what you mean by natural join.</description>
    <pubDate>Thu, 09 Nov 2017 03:41:01 GMT</pubDate>
    <dc:creator>newbie_ari</dc:creator>
    <dc:date>2017-11-09T03:41:01Z</dc:date>
    <item>
      <title>SQL MERGE USING MACRO FOR MULTIPLE VARIABLES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-MERGE-USING-MACRO-FOR-MULTIPLE-VARIABLES/m-p/411607#M279709</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've 2 datasets which has 6 columns in 1 dataset &amp;amp; another has 8 columns. But first 5 columns are same in both. Say first dataset name is A and another B. I want to merge the 2 dataset such that I get 9 total columns. Generally we merge using SQL in the following way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table example as
select a.*,b.var1,b.var2,b.var3
from A as a left join B as b
on a.key1 = b.key1 and a.key2 = b.key2 and a.key3 = b.key3 and a.key4 = b.key4 and a.key5 = b.key5;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;And if I need to merge the table again and again, I've to repeatedly write the 5 keys again and again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My question is, is there any way I can pass the key in macro and call the macro while merging?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 17:49:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-MERGE-USING-MACRO-FOR-MULTIPLE-VARIABLES/m-p/411607#M279709</guid>
      <dc:creator>newbie_ari</dc:creator>
      <dc:date>2017-11-08T17:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: SQL MERGE USING MACRO FOR MULTIPLE VARIABLES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-MERGE-USING-MACRO-FOR-MULTIPLE-VARIABLES/m-p/411610#M279710</link>
      <description>&lt;P&gt;Try a Natural JOIN instead.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 18:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-MERGE-USING-MACRO-FOR-MULTIPLE-VARIABLES/m-p/411610#M279710</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-08T18:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: SQL MERGE USING MACRO FOR MULTIPLE VARIABLES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-MERGE-USING-MACRO-FOR-MULTIPLE-VARIABLES/m-p/411800#M279711</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;: Thanks for your reply. But could you please elaborate on what you mean by natural join.</description>
      <pubDate>Thu, 09 Nov 2017 03:41:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-MERGE-USING-MACRO-FOR-MULTIPLE-VARIABLES/m-p/411800#M279711</guid>
      <dc:creator>newbie_ari</dc:creator>
      <dc:date>2017-11-09T03:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: SQL MERGE USING MACRO FOR MULTIPLE VARIABLES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-MERGE-USING-MACRO-FOR-MULTIPLE-VARIABLES/m-p/411802#M279712</link>
      <description>&lt;P&gt;Google is your friend.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.datasavantconsulting.com/roland/natjoin.html" target="_blank"&gt;http://www.datasavantconsulting.com/roland/natjoin.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 03:43:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-MERGE-USING-MACRO-FOR-MULTIPLE-VARIABLES/m-p/411802#M279712</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-09T03:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: SQL MERGE USING MACRO FOR MULTIPLE VARIABLES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-MERGE-USING-MACRO-FOR-MULTIPLE-VARIABLES/m-p/411853#M279713</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;: Thanks a lot! Your answer was so uncommon I didn't bother to google it. I thought you wrote something wrong. I'm working on SQL for quite sometime &amp;amp; had the impression that I know SQL pretty well. But life has it's own way to show you your limitations &amp;amp; keeps you humble. Thanks again!</description>
      <pubDate>Thu, 09 Nov 2017 10:08:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-MERGE-USING-MACRO-FOR-MULTIPLE-VARIABLES/m-p/411853#M279713</guid>
      <dc:creator>newbie_ari</dc:creator>
      <dc:date>2017-11-09T10:08:58Z</dc:date>
    </item>
  </channel>
</rss>

