<?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: Left Join to multiple separatable tables in one sql step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Left-Join-to-multiple-separatable-tables-in-one-sql-step/m-p/542639#M149939</link>
    <description>&lt;P&gt;Thank you very much!!&lt;/P&gt;</description>
    <pubDate>Wed, 13 Mar 2019 02:36:55 GMT</pubDate>
    <dc:creator>TheNovice</dc:creator>
    <dc:date>2019-03-13T02:36:55Z</dc:date>
    <item>
      <title>Left Join to multiple separatable tables in one sql step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-Join-to-multiple-separatable-tables-in-one-sql-step/m-p/542118#M149789</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset Q with Jan and Feb data (With duplicates). I have 2 month end datasets for Jan and Feb. I need to join the Jan data in Q to Jan ME and Feb data in Q to Feb ME. Variables in both ME datasets are named the same&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Doing it separately in 2 steps is obviously easy but is it possible to do it in one proc sql step ? This would be helpful as the dataset Q gets populated with more months.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ME sets are in format XY_20190131 and XY_20190228&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any direction would be appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 17:05:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-Join-to-multiple-separatable-tables-in-one-sql-step/m-p/542118#M149789</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-03-11T17:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Left Join to multiple separatable tables in one sql step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-Join-to-multiple-separatable-tables-in-one-sql-step/m-p/542121#M149790</link>
      <description>&lt;P&gt;Something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    create table abc as select a.variable1,a.variable2,b.variable3,c.variable4
        from a left join b on a.variable1=b.variable1
        left join c on a.variable1=c.variable1;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Mar 2019 17:09:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-Join-to-multiple-separatable-tables-in-one-sql-step/m-p/542121#M149790</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-03-11T17:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Left Join to multiple separatable tables in one sql step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-Join-to-multiple-separatable-tables-in-one-sql-step/m-p/542138#M149797</link>
      <description>&lt;P&gt;Thank you Paige,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output I need would need to look like the End result table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The orig table is the main table and there is a jan result and feb result table. I want to join to the respective month end tables based on the month listed in the original table on a.id = b.id or whatnot.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But can joining to 2 tables in step be done in one proc sql statement?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27837iDF48C3D4E1A0819D/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 17:32:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-Join-to-multiple-separatable-tables-in-one-sql-step/m-p/542138#M149797</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-03-11T17:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Left Join to multiple separatable tables in one sql step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-Join-to-multiple-separatable-tables-in-one-sql-step/m-p/542252#M149819</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/248692"&gt;@TheNovice&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But can joining to 2 tables in step be done in one proc sql statement?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I believe I already showed it could be done, and provided an example of code.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 00:26:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-Join-to-multiple-separatable-tables-in-one-sql-step/m-p/542252#M149819</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-03-12T00:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Left Join to multiple separatable tables in one sql step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-Join-to-multiple-separatable-tables-in-one-sql-step/m-p/542321#M149850</link>
      <description>&lt;P&gt;It is not a good idea to have separate datasets for each month. But sometimes, that's what you get.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The easy way to handle this case may be to collect the monthly data in a data step view before joining, e.g.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data XY_2019/View=XY_2019;
  set inlib.XY_2019: indsname=dsname;
  filedate=input(scan(dsname,2,'_'),yymmdd8.);
  format filedate date9.;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can then join your Q table to that using a standard SQL left join.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 10:58:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-Join-to-multiple-separatable-tables-in-one-sql-step/m-p/542321#M149850</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2019-03-12T10:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Left Join to multiple separatable tables in one sql step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-Join-to-multiple-separatable-tables-in-one-sql-step/m-p/542639#M149939</link>
      <description>&lt;P&gt;Thank you very much!!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 02:36:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-Join-to-multiple-separatable-tables-in-one-sql-step/m-p/542639#M149939</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-03-13T02:36:55Z</dc:date>
    </item>
  </channel>
</rss>

