<?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: join many tables with SQL full outer join in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/join-many-tables-with-SQL-full-outer-join/m-p/258411#M49760</link>
    <description>Just use the FILM JOIN - ON construct.&lt;BR /&gt;Why do you want to use SQL I'd you already have a working piece of code? &lt;BR /&gt;&lt;BR /&gt;Without knowing anything about the data, but shouldn't a union be more appropriate? Looks like you are denormalizing.</description>
    <pubDate>Wed, 23 Mar 2016 06:04:36 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2016-03-23T06:04:36Z</dc:date>
    <item>
      <title>join many tables with SQL full outer join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/join-many-tables-with-SQL-full-outer-join/m-p/258408#M49757</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA REVENUE;
MERGE REV_1004 (KEEP = ID REVENUE RENAME =(REVENUE = REV1004)
	REV_1005 (KEEP = ID REVENUE RENAME =(REVENUE = REV1005)
	REV_1006 (KEEP = ID REVENUE RENAME =(REVENUE = REV1006)
	REV_1007 (KEEP = ID REVENUE RENAME =(REVENUE = REV1007)
	REV_1008 (KEEP = ID REVENUE RENAME =(REVENUE = REV1008)
	REV_1009 (KEEP = ID REVENUE RENAME =(REVENUE = REV1009)
	REV_1010 (KEEP = ID REVENUE RENAME =(REVENUE = REV1010)
	REV_1011 (KEEP = ID REVENUE RENAME =(REVENUE = REV1011)
	REV_1012 (KEEP = ID REVENUE RENAME =(REVENUE = REV1012)
	REV_1101 (KEEP = ID REVENUE RENAME =(REVENUE = REV1101)
	REV_1102 (KEEP = ID REVENUE RENAME =(REVENUE = REV1102)
	REV_1103 (KEEP = ID REVENUE RENAME =(REVENUE = REV1103);
BY ID;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would like to write the same code in SQL and output supposed to be same, any help?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2016 05:09:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/join-many-tables-with-SQL-full-outer-join/m-p/258408#M49757</guid>
      <dc:creator>Alankar</dc:creator>
      <dc:date>2016-03-23T05:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: join many tables with SQL full outer join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/join-many-tables-with-SQL-full-outer-join/m-p/258411#M49760</link>
      <description>Just use the FILM JOIN - ON construct.&lt;BR /&gt;Why do you want to use SQL I'd you already have a working piece of code? &lt;BR /&gt;&lt;BR /&gt;Without knowing anything about the data, but shouldn't a union be more appropriate? Looks like you are denormalizing.</description>
      <pubDate>Wed, 23 Mar 2016 06:04:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/join-many-tables-with-SQL-full-outer-join/m-p/258411#M49760</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-23T06:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: join many tables with SQL full outer join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/join-many-tables-with-SQL-full-outer-join/m-p/258418#M49763</link>
      <description>&lt;P&gt;I would echo suggestion from above, union or stack datasets and then transpose from wide to long.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2016 07:39:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/join-many-tables-with-SQL-full-outer-join/m-p/258418#M49763</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-23T07:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: join many tables with SQL full outer join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/join-many-tables-with-SQL-full-outer-join/m-p/258420#M49765</link>
      <description>&lt;P&gt;The only thing that I would do with this code is that I would automate it so I only need to set begin and end months, and the code is built dynamically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let begin='01apr2010'd;
%let end='01mar2011'd;

data _null_;
length command $100;
date = &amp;amp;begin;
call execute('data revenue; merge ');
do while (date &amp;lt;= &amp;amp;end);
  yymm = substr(put(year(date),z4.),3,2)!!put(month(date),z2.);
  command = 'rev_'!!yymm!!' (keep=id revenue rename=(revenue = rev'!!yymm!!')';
  call execute(command);
  date = intnx('month',date,1,'begin');
end;
call execute('; by id; run;');
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Mar 2016 08:12:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/join-many-tables-with-SQL-full-outer-join/m-p/258420#M49765</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-03-23T08:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: join many tables with SQL full outer join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/join-many-tables-with-SQL-full-outer-join/m-p/258495#M49811</link>
      <description>&lt;P&gt;In this particular case one could also shorten the code to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA _NULL_;
   SET sashelp.vtable end=last;
   where libname eq 'WORK' and substr(memname,1,4) eq 'REV_';
   if _N_ eq 1 then call execute('DATA REVENUE; MERGE ');
   call execute(strip(memname)||' (KEEP = ID REVENUE RENAME =(REVENUE = '||strip(compress(memname,"_"))||'))');
   if last then call execute(';BY ID; RUN;');
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2016 13:26:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/join-many-tables-with-SQL-full-outer-join/m-p/258495#M49811</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2016-03-23T13:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: join many tables with SQL full outer join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/join-many-tables-with-SQL-full-outer-join/m-p/259009#M50029</link>
      <description>&lt;P&gt;I am exploring SQL options, thus trying to convert SAS data steps and procedures in to PROC SQL.&lt;/P&gt;
&lt;P&gt;by the way do we have FILM JOIN? never heard of it. how to use?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2016 02:27:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/join-many-tables-with-SQL-full-outer-join/m-p/259009#M50029</guid>
      <dc:creator>Alankar</dc:creator>
      <dc:date>2016-03-25T02:27:35Z</dc:date>
    </item>
  </channel>
</rss>

