<?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 PROC SQL-Combining data from multiple tables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Combining-data-from-multiple-tables/m-p/216961#M53398</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt; I want to create Table_C from Table_A by excluding the values found on TABLE_B based on both variables : ALPHA and BETA&lt;/P&gt;&lt;P&gt;Table_A has ALPHA and BETA as well as many other variables.&lt;/P&gt;&lt;P&gt;Table_B&amp;nbsp; has only the variables ALPHA and BETA&lt;/P&gt;&lt;P&gt; Table_C should have less observations then Table_A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All SQL commands I tried (like the one below) gave me 9 times more observations than expected, meaning that the cartesian product is not the one expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000080; font-size: 10pt; font-family: Verdana;"&gt;&lt;SPAN style="color: #575757;"&gt;proc &lt;/SPAN&gt;&lt;STRONG&gt;sql&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Verdana;"&gt;create&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Verdana;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt; table_C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Verdana;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Verdana;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Verdana;"&gt;g1.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt;*,&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Verdana;"&gt;g2.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt;*&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Verdana;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt; Table_A g1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Verdana;"&gt;left&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Verdana;"&gt;join&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt; TABLE_B g2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Verdana;"&gt;ON&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt; g1.ALPHA ne g2.ALPHA&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Verdana;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; g1.BETA ne g2.BETA&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt; font-family: Verdana;"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other way to describe the problem :&lt;/P&gt;&lt;P&gt;I want sashelp.class without the follwing observations :&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 986px; height: 76px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Age&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;weight&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;13&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;84&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;13&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;98&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt;Thanks in advance for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Jun 2015 15:55:54 GMT</pubDate>
    <dc:creator>nketata</dc:creator>
    <dc:date>2015-06-30T15:55:54Z</dc:date>
    <item>
      <title>PROC SQL-Combining data from multiple tables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Combining-data-from-multiple-tables/m-p/216961#M53398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt; I want to create Table_C from Table_A by excluding the values found on TABLE_B based on both variables : ALPHA and BETA&lt;/P&gt;&lt;P&gt;Table_A has ALPHA and BETA as well as many other variables.&lt;/P&gt;&lt;P&gt;Table_B&amp;nbsp; has only the variables ALPHA and BETA&lt;/P&gt;&lt;P&gt; Table_C should have less observations then Table_A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All SQL commands I tried (like the one below) gave me 9 times more observations than expected, meaning that the cartesian product is not the one expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000080; font-size: 10pt; font-family: Verdana;"&gt;&lt;SPAN style="color: #575757;"&gt;proc &lt;/SPAN&gt;&lt;STRONG&gt;sql&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Verdana;"&gt;create&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Verdana;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt; table_C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Verdana;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Verdana;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Verdana;"&gt;g1.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt;*,&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Verdana;"&gt;g2.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt;*&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Verdana;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt; Table_A g1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Verdana;"&gt;left&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Verdana;"&gt;join&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt; TABLE_B g2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Verdana;"&gt;ON&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt; g1.ALPHA ne g2.ALPHA&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Verdana;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; g1.BETA ne g2.BETA&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt; font-family: Verdana;"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other way to describe the problem :&lt;/P&gt;&lt;P&gt;I want sashelp.class without the follwing observations :&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 986px; height: 76px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Age&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;weight&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;13&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;84&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;13&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;98&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt;Thanks in advance for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2015 15:55:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Combining-data-from-multiple-tables/m-p/216961#M53398</guid>
      <dc:creator>nketata</dc:creator>
      <dc:date>2015-06-30T15:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL-Combining data from multiple tables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Combining-data-from-multiple-tables/m-p/216962#M53399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana; color: #000080;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333320617676px; font-family: inherit; color: #575757;"&gt;proc &lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333320617676px; font-family: inherit;"&gt;sql&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana; color: #0000ff;"&gt;create&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana; color: #0000ff;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana;"&gt; table_C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana; color: #0000ff;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana; color: #0000ff;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana; color: #008080;"&gt;g1.&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana;"&gt;*,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana; color: #008080;"&gt;g2.&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana;"&gt;*&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana; color: #0000ff;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana;"&gt; Table_A g1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana; color: #0000ff;"&gt;left&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana; color: #0000ff;"&gt;join&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana;"&gt; TABLE_B g2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana; color: #0000ff;"&gt;ON&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana;"&gt; g1.ALPHA eq g2.ALPHA&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana; color: #0000ff;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; g1.BETA eq g2.BETA&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana;"&gt;where g2.beta is null;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: Verdana; color: #000080;"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2015 15:58:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Combining-data-from-multiple-tables/m-p/216962#M53399</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2015-06-30T15:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL-Combining data from multiple tables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Combining-data-from-multiple-tables/m-p/216963#M53400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great, thanks. The log gave me a warning about alpha and beta being on both files, but the output is valid.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2015 16:15:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Combining-data-from-multiple-tables/m-p/216963#M53400</guid>
      <dc:creator>nketata</dc:creator>
      <dc:date>2015-06-30T16:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL-Combining data from multiple tables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Combining-data-from-multiple-tables/m-p/216964#M53401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a solution using a datastep or proc sql;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data table_a;&lt;/P&gt;&lt;P&gt;infile cards;&lt;/P&gt;&lt;P&gt;input age weight;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;13 84&lt;/P&gt;&lt;P&gt;13 98&lt;/P&gt;&lt;P&gt;14 101&lt;/P&gt;&lt;P&gt;15 250&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data table_b;&lt;/P&gt;&lt;P&gt;infile cards;&lt;/P&gt;&lt;P&gt;input age weight;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;13 84&lt;/P&gt;&lt;P&gt;13 98&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data table_c_1;&lt;/P&gt;&lt;P&gt;merge table_a(in=a)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table_b(in=b);&lt;/P&gt;&lt;P&gt;by age weight;&lt;/P&gt;&lt;P&gt;if a and not b;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table table_c_2 as&lt;/P&gt;&lt;P&gt;select age,weight&lt;/P&gt;&lt;P&gt;from table_a a where not exists (&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from table_b b&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where a.age = b.age and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a.weight = b.weight);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2015 16:24:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Combining-data-from-multiple-tables/m-p/216964#M53401</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-06-30T16:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL-Combining data from multiple tables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Combining-data-from-multiple-tables/m-p/216965#M53402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A correlated sub-query is the simplest and most explicit approach:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table tableC as &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select * &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from TableA as A&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where not exists (select * from TableB where ALPHA=A.ALPHA and BETA=A.BETA);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2015 17:13:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Combining-data-from-multiple-tables/m-p/216965#M53402</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-06-30T17:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL-Combining data from multiple tables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Combining-data-from-multiple-tables/m-p/216966#M53403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I was aware of the &lt;EM&gt;if a and not b&lt;/EM&gt; in the data-merge but I wanted to avoid the sorting on huge files.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2015 17:44:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Combining-data-from-multiple-tables/m-p/216966#M53403</guid>
      <dc:creator>nketata</dc:creator>
      <dc:date>2015-06-30T17:44:12Z</dc:date>
    </item>
  </channel>
</rss>

