<?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 outer join syntax without using proc sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Left-outer-join-syntax-without-using-proc-sql/m-p/756389#M238787</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have studied the documentation. It was explained not very easy to grasp. I found a white paper in SAS community which helped me to understand the topic. Aslo, there is a forum member named Jimbourbar explained it very well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so I have the concept now and tomorrow, I have to test the syntax.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;blueblue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 24 Jul 2021 06:28:45 GMT</pubDate>
    <dc:creator>GN0001</dc:creator>
    <dc:date>2021-07-24T06:28:45Z</dc:date>
    <item>
      <title>Left outer join syntax without using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-outer-join-syntax-without-using-proc-sql/m-p/756366#M238766</link>
      <description>&lt;P&gt;Hello team,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can we do Left outer join in SAS without using sql?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can someone help me with this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;blueblue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jul 2021 03:56:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-outer-join-syntax-without-using-proc-sql/m-p/756366#M238766</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-07-24T03:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Left outer join syntax without using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-outer-join-syntax-without-using-proc-sql/m-p/756373#M238771</link>
      <description>&lt;P&gt;Sure.&amp;nbsp; Just do what we did before there was Proc SQL; use a Merge.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here, I'm going to do essentially a left join.&amp;nbsp; I'm joining in phone_number, but I want to keep the individual even if I can't get a phone number for them. Regrettably, I couldn't get a phone number for Joe Biden and Jeff Bezos for this example.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA	Have;
	LENGTH	ID $4	Name $64	Address $64	City $64;
	INFILE	DATALINES	MISSOVER	DSD	DLM='09'x;
	INPUT	ID $	Name $		Address $	City $;
DATALINES;
2418	Barbara Ann	1515 Android Lane	Milwaulkee
2724	Walt Disney	48 IBM Way	Anaheim
5429	John Q Public	24 Apple Str	Des Moines
9527	Joe Biden	1600 Pennsylvania Avenue NW	Washington D.C.
9610	Jeff Bezos	1 Blue Origin St	Kent
;
RUN;

DATA	Have2;
	LENGTH	ID $4	Phone_Number $12;
	INFILE	DATALINES	MISSOVER	DSD	DLM='09'x;
	INPUT	ID $	Phone_Number $;
DATALINES;
2418	555-222-3333
2724	888-444-111
5429	999-876-5309
;
RUN;

PROC	SORT	DATA=Have;
			BY	ID;
RUN;

PROC	SORT	DATA=Have2;
			BY	ID;
RUN;

DATA	Want;
	MERGE	Have	(IN=Have)
			Have2	(IN=Have2);
			BY	ID;
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results below.&amp;nbsp; Note how individuals without a phone number are still present in the results.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1627102649090.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61669i9B1AFEACDE30EFA2/image-size/large?v=v2&amp;amp;px=999" role="button" title="jimbarbour_0-1627102649090.png" alt="jimbarbour_0-1627102649090.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jul 2021 04:57:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-outer-join-syntax-without-using-proc-sql/m-p/756373#M238771</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-07-24T04:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Left outer join syntax without using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-outer-join-syntax-without-using-proc-sql/m-p/756381#M238779</link>
      <description>&lt;P&gt;This is a great input.&lt;/P&gt;
&lt;P&gt;Thanks for this response:&lt;/P&gt;
&lt;P&gt;Does this&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;	MERGE	Have	(IN=Have)
			Have2	(IN=Have2);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mean all the rows in the output, regardless whether there is a match or not.&lt;/P&gt;
&lt;P&gt;What is the syntax if you want to bring all the cases?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;blueblue&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jul 2021 05:58:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-outer-join-syntax-without-using-proc-sql/m-p/756381#M238779</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-07-24T05:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Left outer join syntax without using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-outer-join-syntax-without-using-proc-sql/m-p/756387#M238785</link>
      <description>&lt;P&gt;Please&amp;nbsp;&lt;STRONG&gt;do&lt;/STRONG&gt; study the documentation of the MERGE statement.&lt;/P&gt;
&lt;P&gt;In short, MERGE reads observations side-by-side. HOW it does that is controlled by an (optional) BY statement; subsequent conditions can be used to keep observations selectively.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jul 2021 06:22:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-outer-join-syntax-without-using-proc-sql/m-p/756387#M238785</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-24T06:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Left outer join syntax without using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-outer-join-syntax-without-using-proc-sql/m-p/756388#M238786</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202329"&gt;@GN0001&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Does this&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;	MERGE	Have	(IN=Have)
			Have2	(IN=Have2);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mean all the rows in the output, regardless whether there is a match or not.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes.&amp;nbsp; Since I'm not using any conditions to limit the records in the output Data set, all rows are kept.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jul 2021 06:28:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-outer-join-syntax-without-using-proc-sql/m-p/756388#M238786</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-07-24T06:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Left outer join syntax without using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-outer-join-syntax-without-using-proc-sql/m-p/756389#M238787</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have studied the documentation. It was explained not very easy to grasp. I found a white paper in SAS community which helped me to understand the topic. Aslo, there is a forum member named Jimbourbar explained it very well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so I have the concept now and tomorrow, I have to test the syntax.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;blueblue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jul 2021 06:28:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-outer-join-syntax-without-using-proc-sql/m-p/756389#M238787</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-07-24T06:28:45Z</dc:date>
    </item>
  </channel>
</rss>

