<?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 Set of two tables on proc sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Set-of-two-tables-on-proc-sql/m-p/906545#M357948</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like replace the set of two tables by proc sql. Do I need to write full join statement to do that?&lt;/P&gt;
&lt;P&gt;I mean, I would like to put two tables one after the other.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 06 Dec 2023 17:34:06 GMT</pubDate>
    <dc:creator>SASdevAnneMarie</dc:creator>
    <dc:date>2023-12-06T17:34:06Z</dc:date>
    <item>
      <title>Set of two tables on proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Set-of-two-tables-on-proc-sql/m-p/906545#M357948</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like replace the set of two tables by proc sql. Do I need to write full join statement to do that?&lt;/P&gt;
&lt;P&gt;I mean, I would like to put two tables one after the other.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 17:34:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Set-of-two-tables-on-proc-sql/m-p/906545#M357948</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2023-12-06T17:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Set of two tables on proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Set-of-two-tables-on-proc-sql/m-p/906546#M357949</link>
      <description>&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/sqlproc/1.0/n0vo2lglyrnexwn14emi8m0jqvrj.htm#p0wx2rzvreep08n1h87if6u0gn82" target="_self"&gt;OUTER UNION&lt;/A&gt; seems to work in this case.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 17:39:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Set-of-two-tables-on-proc-sql/m-p/906546#M357949</guid>
      <dc:creator>A_Kh</dc:creator>
      <dc:date>2023-12-06T17:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Set of two tables on proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Set-of-two-tables-on-proc-sql/m-p/906548#M357950</link>
      <description>Thank you ! I have this error four outer join : ERROR 73-322: Expecting an UNION.</description>
      <pubDate>Wed, 06 Dec 2023 17:51:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Set-of-two-tables-on-proc-sql/m-p/906548#M357950</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2023-12-06T17:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set of two tables on proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Set-of-two-tables-on-proc-sql/m-p/906549#M357951</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data T1 T2;
input A B C D E F;
if mod(_N_,2) then output T1;
              else output T2;
cards;
1 2 3 4 5 6
2 3 4 5 6 7
3 4 5 6 7 8
4 5 6 7 8 9
5 6 7 8 9 0
;
run;

data t12_ds;
  set  t1 t2;
run;

proc sql;
create table t12_sql as
select * from T1
union ALL
select * from T2
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Dec 2023 17:52:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Set-of-two-tables-on-proc-sql/m-p/906549#M357951</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-12-06T17:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Set of two tables on proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Set-of-two-tables-on-proc-sql/m-p/906550#M357952</link>
      <description>&lt;P&gt;Did you use OUTER JOIN or&amp;nbsp;OUTER UNION?&lt;/P&gt;
&lt;P&gt;When you use outer union datasets get appended, and all variables are kept (if only UNION, only common variables from input datasets will be kept), and CORR option will align common variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And your error is referring to your syntax, most likely you write OUTER JOIN, instead of OUTER UNION.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 18:06:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Set-of-two-tables-on-proc-sql/m-p/906550#M357952</guid>
      <dc:creator>A_Kh</dc:creator>
      <dc:date>2023-12-06T18:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set of two tables on proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Set-of-two-tables-on-proc-sql/m-p/906552#M357953</link>
      <description>Thank you,&lt;BR /&gt;Is it possible to do the union statement after the left join ?&lt;BR /&gt;I have to do the left join with 3 tables and add the last one with union statement.</description>
      <pubDate>Wed, 06 Dec 2023 18:15:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Set-of-two-tables-on-proc-sql/m-p/906552#M357953</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2023-12-06T18:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set of two tables on proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Set-of-two-tables-on-proc-sql/m-p/906553#M357954</link>
      <description>&lt;P&gt;It's called &lt;A title="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068/show-comments/false" href="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068/show-comments/false" target="_self"&gt;Maxim#4&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table t12_sql as
(
select t1.* 
from T1
left join T3
on t1.A=t3.A
)
union ALL
select * from T2
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Dec 2023 18:20:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Set-of-two-tables-on-proc-sql/m-p/906553#M357954</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-12-06T18:20:10Z</dc:date>
    </item>
  </channel>
</rss>

