<?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: Outer Union Merge of 2 Large Data Sets Using SQL (SAS 9.4) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Outer-Union-Merge-of-2-Large-Data-Sets-Using-SQL-SAS-9-4/m-p/431574#M281727</link>
    <description>&lt;P&gt;OUTER UNION is for concatenating datasets, not merging And ALL is not allowed with OUTER UNION in SAS/SQL. So I suspect that it is not the operation you really want.&lt;/P&gt;</description>
    <pubDate>Sun, 28 Jan 2018 03:49:05 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2018-01-28T03:49:05Z</dc:date>
    <item>
      <title>Outer Union Merge of 2 Large Data Sets Using SQL (SAS 9.4)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outer-Union-Merge-of-2-Large-Data-Sets-Using-SQL-SAS-9-4/m-p/431521#M281725</link>
      <description>&lt;P&gt;I am currently trying to merge 2 large data sets using SQL. I haven't had to merge data of this size before, and I need to find an efficient way to merge the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first data set, home._2004, contains 45 variables and 67 million observations.&lt;/P&gt;&lt;P&gt;The second data set, home.c2final, contains 73 variables and 24 million observations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are some example observations and variables to show that the data sets have some, but not all variables in common.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sample Data&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;home._2004&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Year&amp;nbsp; &amp;nbsp; &amp;nbsp; State&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MSA&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2004&amp;nbsp; &amp;nbsp; &amp;nbsp; NE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;00561&lt;/P&gt;&lt;P&gt;2004&amp;nbsp; &amp;nbsp; &amp;nbsp; AL&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 15646&lt;/P&gt;&lt;P&gt;2004&amp;nbsp; &amp;nbsp; &amp;nbsp; AL&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 45646&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;home.c2final&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Year&amp;nbsp; &amp;nbsp; &amp;nbsp; State&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Loan_Amount&lt;/P&gt;&lt;P&gt;1999&amp;nbsp; &amp;nbsp; &amp;nbsp;NE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 55000&lt;/P&gt;&lt;P&gt;2004&amp;nbsp; &amp;nbsp; &amp;nbsp;KS&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;165000&lt;/P&gt;&lt;P&gt;2005&amp;nbsp; &amp;nbsp; &amp;nbsp;AK&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 200000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been using:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA home._2004;
SET home._2004data (obs=10);
RUN;

DATA home.c2final;
SET home.c2 (obs=50);
RUN;

PROC SQL;
      CREATE TABLE home.merge as
      SELECT *
           FROM home._2004
       OUTER UNION ALL
       SELECT *
           FROM home.c2final;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This works when I am only using a few observations from each, but they are too large to do all together. When I used 10 observations from home._2004 and all observations from home.c2final it takes 10 minutes. I am trying to find a way to make this more efficient. My thought was to find a way to merge a number of observations from home._2004 with all of home.c2final, and have the program do this with the next group of observations until all of the data is merged.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example if I used 50 observations from home._2004:&lt;/P&gt;&lt;P&gt;Observations 1-50 merge with c2final&lt;/P&gt;&lt;P&gt;Followed by&lt;/P&gt;&lt;P&gt;Observations 51-100 merge with c2final&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to SAS, and I am not sure if this is even a possibility.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jan 2018 07:45:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outer-Union-Merge-of-2-Large-Data-Sets-Using-SQL-SAS-9-4/m-p/431521#M281725</guid>
      <dc:creator>Bennettr99</dc:creator>
      <dc:date>2018-01-27T07:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Outer Union Merge of 2 Large Data Sets Using SQL (SAS 9.4)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outer-Union-Merge-of-2-Large-Data-Sets-Using-SQL-SAS-9-4/m-p/431522#M281726</link>
      <description>&lt;P&gt;Step 1: know your data (also Maxim 3).&lt;/P&gt;
&lt;P&gt;Determine their relationship with regard to the join keys (one-to-one, one-to-many, many-to-many).&lt;/P&gt;
&lt;P&gt;See if other variables appear in both datasets, and determine what to do with them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From that information, we can help in finding the best approach.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jan 2018 08:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outer-Union-Merge-of-2-Large-Data-Sets-Using-SQL-SAS-9-4/m-p/431522#M281726</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-27T08:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Outer Union Merge of 2 Large Data Sets Using SQL (SAS 9.4)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outer-Union-Merge-of-2-Large-Data-Sets-Using-SQL-SAS-9-4/m-p/431574#M281727</link>
      <description>&lt;P&gt;OUTER UNION is for concatenating datasets, not merging And ALL is not allowed with OUTER UNION in SAS/SQL. So I suspect that it is not the operation you really want.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jan 2018 03:49:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outer-Union-Merge-of-2-Large-Data-Sets-Using-SQL-SAS-9-4/m-p/431574#M281727</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-01-28T03:49:05Z</dc:date>
    </item>
  </channel>
</rss>

