<?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: Fetching the column in PROC SQL where the outer join gets performed in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Fetching-the-column-in-PROC-SQL-where-the-outer-join-gets/m-p/69893#M20110</link>
    <description>You should always use COALESCE() function on common columns when performing a full join.&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
    <pubDate>Mon, 19 Jan 2009 12:48:12 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2009-01-19T12:48:12Z</dc:date>
    <item>
      <title>Fetching the column in PROC SQL where the outer join gets performed</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Fetching-the-column-in-PROC-SQL-where-the-outer-join-gets/m-p/69892#M20109</link>
      <description>Hi, &lt;BR /&gt;
&lt;BR /&gt;
I have been using the below query to perform outer join on a column&lt;BR /&gt;
&lt;BR /&gt;
Proc Sql;&lt;BR /&gt;
&lt;BR /&gt;
create table All_Acc as select &lt;BR /&gt;
&lt;BR /&gt;
a.acct,&lt;BR /&gt;
a.year,&lt;BR /&gt;
b.acct,&lt;BR /&gt;
b.sysdate,&lt;BR /&gt;
b.fin,&lt;BR /&gt;
b.mnts&lt;BR /&gt;
&lt;BR /&gt;
from &lt;BR /&gt;
Accts_abc a  full outer join Accts_def  b&lt;BR /&gt;
on a.acct = b.acct&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
The problem now is that any value for acct which is in b and not in a is giving me a null value on that column. Even if i reverse the join condition b on a , it happens for acct values present in a and not in b.&lt;BR /&gt;
&lt;BR /&gt;
I cant use a MERGE at datastep level (if a or b) since i ll have to sort the above 2 datasets, which I am trying to avoid due to the Temp Space it requires.&lt;BR /&gt;
&lt;BR /&gt;
Basically, I thought the above PROC SQL should have wrkd the same as merge, and kept acct values whereever it is in the 2 datasets.&lt;BR /&gt;
&lt;BR /&gt;
Can someone pls suggest a way out.&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
Tej</description>
      <pubDate>Sun, 18 Jan 2009 06:28:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Fetching-the-column-in-PROC-SQL-where-the-outer-join-gets/m-p/69892#M20109</guid>
      <dc:creator>tejeshwar</dc:creator>
      <dc:date>2009-01-18T06:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching the column in PROC SQL where the outer join gets performed</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Fetching-the-column-in-PROC-SQL-where-the-outer-join-gets/m-p/69893#M20110</link>
      <description>You should always use COALESCE() function on common columns when performing a full join.&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Mon, 19 Jan 2009 12:48:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Fetching-the-column-in-PROC-SQL-where-the-outer-join-gets/m-p/69893#M20110</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-01-19T12:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching the column in PROC SQL where the outer join gets performed</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Fetching-the-column-in-PROC-SQL-where-the-outer-join-gets/m-p/69894#M20111</link>
      <description>Thanks so much, it resolved my problem to getting null rows on the merging_key</description>
      <pubDate>Wed, 21 Jan 2009 03:01:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Fetching-the-column-in-PROC-SQL-where-the-outer-join-gets/m-p/69894#M20111</guid>
      <dc:creator>tejeshwar</dc:creator>
      <dc:date>2009-01-21T03:01:58Z</dc:date>
    </item>
  </channel>
</rss>

