<?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: Merging tables by joining a column of one table with several columns of the other table in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139353#M2146</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the DROP= dataset option in the original CREATE TABLE statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create table table1 (DROP=NAME1 NAME2 NAME3) as &lt;/P&gt;&lt;P&gt;select .....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 07 Dec 2014 06:12:05 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2014-12-07T06:12:05Z</dc:date>
    <item>
      <title>Merging tables by joining a column of one table with several columns of the other table</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139345#M2138</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;suppose I have File1:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="124" style="border: 1px solid #000000; width: 82px; height: 92px;" width="80"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Name&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&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;and File2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="99" style="border: 1px solid rgb(0, 0, 0); width: 204px; height: 94px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;name1&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;name2&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;name3&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;ss&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;sss&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;dd&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;ddd&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;kk&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;kkk&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to merge by names, but in the second file the names that I need are dispersed in several columns.&lt;/P&gt;&lt;P&gt;For example, if I merge by joining column Name from File1 with column name1 from File2, I will get a merge for entry A, but not for B and C because there are no B and C in the column name1 in File2.&lt;/P&gt;&lt;P&gt;So how is it possible to make such that the merge is looking at the 3 name columns in File2 to find a corresponding value from the column Name in File1?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Dec 2014 19:47:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139345#M2138</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2014-12-06T19:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Merging tables by joining a column of one table with several columns of the other table</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139346#M2139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depending on the size of tables you have two ways that I can think of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Join on all 3 columns:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table table1 as&lt;/P&gt;&lt;P&gt;select a.*, b.*&lt;/P&gt;&lt;P&gt;from file1 as a&lt;/P&gt;&lt;P&gt;join file2 as b&lt;/P&gt;&lt;P&gt;on a.name=b.name1&lt;/P&gt;&lt;P&gt;or a.name=b.name2&lt;/P&gt;&lt;P&gt;or a.name=b.name3;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Cross join and check for a match using the where clause. This is a brute force method and if your tables are large it's painful:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table table2 as&lt;/P&gt;&lt;P&gt;select a.*, b.*&lt;/P&gt;&lt;P&gt;from file1 as a&lt;/P&gt;&lt;P&gt;cross join file2 as b&lt;/P&gt;&lt;P&gt;where whichc(name, name1, name2, name3)&amp;gt;0;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Dec 2014 20:33:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139346#M2139</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-12-06T20:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Merging tables by joining a column of one table with several columns of the other table</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139347#M2140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What happens if &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;File2 is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;name1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;A&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; ss&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sss&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;dd&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B&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; ddd&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;A&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; kkk&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&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>Sat, 06 Dec 2014 22:09:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139347#M2140</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-12-06T22:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Merging tables by joining a column of one table with several columns of the other table</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139348#M2141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for now I assume that the values are unique, but this is a good point which I also thought of, and I guess that in such a case I would need additional join dimensions &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Dec 2014 22:49:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139348#M2141</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2014-12-06T22:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Merging tables by joining a column of one table with several columns of the other table</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139349#M2142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;did both of your codes and they worked on the small example that I made in the beginning, thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was just wondering, is it possible to drop the name1 - name3 at the end of the proc sql, because I was trying and for some reason it didn't work so what I had to do was&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data table1 (drop = name1 name2 name3);&lt;/P&gt;&lt;P&gt;set table1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess that it doesn't change much but just from a point of elegance that I would like to know how to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Dec 2014 23:39:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139349#M2142</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2014-12-06T23:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Merging tables by joining a column of one table with several columns of the other table</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139350#M2143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data file1;&lt;/P&gt;&lt;P&gt;input Name $;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;C&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;data File2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;input (name1 name2 name3)($);&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;A ss sss&lt;/P&gt;&lt;P&gt;dd B ddd&lt;/P&gt;&lt;P&gt;kk kkk C&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;data file3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;set file2;&lt;/P&gt;&lt;P&gt;length name $1.;&lt;/P&gt;&lt;P&gt;array nm{*} name1-name3;&lt;/P&gt;&lt;P&gt;name=nm(_n_);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;data want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;merge file1 file3;&lt;/P&gt;&lt;P&gt;by name;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Dec 2014 23:44:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139350#M2143</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-12-06T23:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Merging tables by joining a column of one table with several columns of the other table</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139351#M2144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another possibility which may (or not) be optimized better than &lt;STRONG&gt;OR&lt;/STRONG&gt;ed conditions by proc SQL :&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 file3 as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select file1.*, file2.*, 1 as match &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from file1 inner join file2 on file1.name=file2.name1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;union all&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select file1.*, file2.*, 2 &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from file1 inner join file2 on file1.name=file2.name2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;union all&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select file1.*, file2.*, 3 &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from file1 inner join file2 on file1.name=file2.name3;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select * from file3;&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>Sun, 07 Dec 2014 02:23:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139351#M2144</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-12-07T02:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Merging tables by joining a column of one table with several columns of the other table</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139352#M2145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Drop the b.* from the SQL code. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's the overall goal of your merge then if your not bringing in fields? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Dec 2014 05:48:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139352#M2145</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-12-07T05:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Merging tables by joining a column of one table with several columns of the other table</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139353#M2146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the DROP= dataset option in the original CREATE TABLE statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create table table1 (DROP=NAME1 NAME2 NAME3) as &lt;/P&gt;&lt;P&gt;select .....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Dec 2014 06:12:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139353#M2146</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-12-07T06:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Merging tables by joining a column of one table with several columns of the other table</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139354#M2147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You said it worked on the small tables being processed. That is great the logical solution works.&lt;/P&gt;&lt;P&gt;But how big are you real tables? This kind of construction will work well when all data as a Cartesian product fits (almost) in memory. The performance will dramatically reduce when it goes into IO processing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Dec 2014 10:31:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139354#M2147</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-12-07T10:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Merging tables by joining a column of one table with several columns of the other table</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139355#M2148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaap,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my tables are at most 300 000 lines each, so I guess this isn't big according to SAS standsrds?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Dec 2014 15:54:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139355#M2148</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2014-12-07T15:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Merging tables by joining a column of one table with several columns of the other table</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139356#M2149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No not very 300k records with a 1K sizing is not very big anymore as being a 300Mb dataset.&lt;/P&gt;&lt;P&gt;Although having a dataset with 300Mb and doing a Cartesian product with a 1Mb dataset (1Kb records 1Kb sized) is going to be an internal 600Gb dataset.&lt;/P&gt;&lt;P&gt;Every originally record will e joined with all 1000 records and the size doubling for all records. 1kb+1Kb. 600Gb is still big these days for your hardware. That is the effect of that Cartesian product as brute force join.&amp;nbsp; Just do some math whether it is acceptable for you.&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Dec 2014 20:35:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139356#M2149</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-12-07T20:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Merging tables by joining a column of one table with several columns of the other table</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139357#M2150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you're not actually bringing in anything from the second table, I'd transpose it and then use a different SQL query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; file1;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;input&lt;/SPAN&gt; Name $;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #0433ff;"&gt;datalines&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;A&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;B&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;C&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; File2;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;input&lt;/SPAN&gt; id (name1 name2 name3)($);&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #0433ff;"&gt;datalines&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;1 A ss sss&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;2 dd B ddd&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;3 kk kkk C&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;transpose&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0433ff;"&gt;data&lt;/SPAN&gt;=file2 &lt;SPAN style="color: #0433ff;"&gt;out&lt;/SPAN&gt;=file3 &lt;SPAN style="color: #0433ff;"&gt;prefix&lt;/SPAN&gt;=Var;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;by&lt;/SPAN&gt; id;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;var&lt;/SPAN&gt; name1-name3;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;sql&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #0433ff;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;create&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;table&lt;SPAN style="color: #000000;"&gt; table1 &lt;/SPAN&gt;as&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #0433ff;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;select&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;a.&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;*&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;from&lt;/SPAN&gt; file1 &lt;SPAN style="color: #0433ff;"&gt;as&lt;/SPAN&gt; a&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;where&lt;/SPAN&gt; name &lt;SPAN style="color: #0433ff;"&gt;in&lt;/SPAN&gt; (&lt;SPAN style="color: #0433ff;"&gt;select&lt;/SPAN&gt; var1 &lt;SPAN style="color: #0433ff;"&gt;from&lt;/SPAN&gt; file3);&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Dec 2014 21:47:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Merging-tables-by-joining-a-column-of-one-table-with-several/m-p/139357#M2150</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-12-07T21:47:10Z</dc:date>
    </item>
  </channel>
</rss>

