<?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: PROC SQL - Left Join Not Working in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477483#M122980</link>
    <description>&lt;P&gt;The situation seems to be like that:&lt;/P&gt;
&lt;P&gt;Each new dataset only contains data for a specific group in the existing dataset. From that, I think that &lt;U&gt;adding&lt;/U&gt; the&lt;/P&gt;
&lt;PRE&gt;a.'Profile Application'n = b.appname&lt;/PRE&gt;
&lt;P&gt;to the on clause of the left join should also work. But taking the appname from the first obs of the incoming file and using that in the where will also work, as the "solved" message shows.&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jul 2018 14:04:04 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-07-12T14:04:04Z</dc:date>
    <item>
      <title>PROC SQL - Left Join Not Working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477046#M122804</link>
      <description>&lt;P&gt;SAS Community,&lt;/P&gt;&lt;P&gt;I have two tables that I'm joining together:&lt;/P&gt;&lt;P&gt;Table A has 1353 observations&lt;/P&gt;&lt;P&gt;Table B has 1352 observations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to keep all observations in table A and only bring in (left join) observations from Table B where they match.&amp;nbsp; Unfortunately, instead of getting all 1353 obs from Table A (since this is a left join), I'm only getting 1352 obs in my final table.&amp;nbsp; Because Table A is the first table, I should get all obs from Table A and only obs from Table B if they match, correct?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;create table RoleStatusRpt as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;select a.*,&lt;BR /&gt;b.'Role Name'n,&lt;BR /&gt;b.'business friendly description'n,&lt;BR /&gt;b.rolecompfinal,&lt;BR /&gt;b.'Role Owner RACF'n,&lt;BR /&gt;b.appname,&lt;BR /&gt;b.'SoD conflict'n as SOD_Conflict,&lt;BR /&gt;b.'SOX Critical (Yes or No)'n,&lt;BR /&gt;b.'Does this Entitlement/Role grant'n,&lt;/P&gt;&lt;P&gt;case when a.role ne b.'Role Name'n then "No Match" end as RoleStatus,&lt;/P&gt;&lt;P&gt;case when a.Description ne b.'business friendly description'n&amp;nbsp;then "No Match" end as BFD_Status,&lt;/P&gt;&lt;P&gt;case when b.'SOX Critical (Yes or No)'n = "Yes" and a.soxcritical = "false" or&amp;nbsp;b.'SOX Critical (Yes or No)'n = "No" and a.soxcritical = "true" then "No Match" END AS SOXStatus,&lt;/P&gt;&lt;P&gt;case when a.rolecomposition ne b.rolecompfinal then "No Match" end as CompositionStatus,&lt;/P&gt;&lt;P&gt;case when a.conflict ne b.'SoD conflict'n then "No Match" end as SODConflictStatus,&lt;/P&gt;&lt;P&gt;case when a.owner ne b.'Role Owner RACF'n then "No Match" end as RACFOwnerStatus,&lt;/P&gt;&lt;P&gt;case when b.'Does this Entitlement/Role grant'n = "Yes" and a.privileged = "false"&amp;nbsp;then "No Match" end as PriviledgeStatus&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;from qa2.sailpoint_role_final as&amp;nbsp;a&lt;BR /&gt;left join&amp;nbsp;app as&amp;nbsp;b&lt;BR /&gt;on (a.role = b.'Role Name'n and&lt;BR /&gt;a.rolecomposition = b.rolecompfinal and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;a.owner = b.'Role Owner RACF'n)&lt;BR /&gt;where a.'Profile Application'n = b.appname&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of getting a total of 1353 obs - my final table has 1352 obs.&amp;nbsp; What am I missing here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS Log:&lt;/P&gt;&lt;P&gt;NOTE: A CASE expression has no ELSE clause. Cases not accounted for by the WHEN clauses will result in a missing value for the CASE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;expression.&lt;BR /&gt;NOTE: A CASE expression has no ELSE clause. Cases not accounted for by the WHEN clauses will result in a missing value for the CASE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;expression.&lt;BR /&gt;NOTE: A CASE expression has no ELSE clause. Cases not accounted for by the WHEN clauses will result in a missing value for the CASE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;expression.&lt;BR /&gt;NOTE: A CASE expression has no ELSE clause. Cases not accounted for by the WHEN clauses will result in a missing value for the CASE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;expression.&lt;BR /&gt;NOTE: A CASE expression has no ELSE clause. Cases not accounted for by the WHEN clauses will result in a missing value for the CASE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;expression.&lt;BR /&gt;NOTE: A CASE expression has no ELSE clause. Cases not accounted for by the WHEN clauses will result in a missing value for the CASE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;expression.&lt;BR /&gt;NOTE: A CASE expression has no ELSE clause. Cases not accounted for by the WHEN clauses will result in a missing value for the CASE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;expression.&lt;BR /&gt;NOTE: Table ROLESTATUSRPT created, with 1352 rows and 24 columns.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 12:24:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477046#M122804</guid>
      <dc:creator>belboy</dc:creator>
      <dc:date>2018-07-11T12:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - Left Join Not Working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477056#M122807</link>
      <description>&lt;P&gt;That might be because of the where clause. Don't expect all the records if you have a where clause.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check this example with and without the where clause.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data table1;
input id name $;
datalines;
1 A
2 A
3 A
4 A
;
run;

data table2;
input id name2 $;
datalines;
1 A
2 A
4 a
;
run;

proc sql;
select a.*,b.name2
from table1 a
left join table2 b
on a.id=b.id
where a.name=b.name2
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Jul 2018 12:46:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477056#M122807</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-07-11T12:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - Left Join Not Working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477057#M122808</link>
      <description>&lt;P&gt;Look here:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where a.'Profile Application'n = b.appname&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have a strong inkling this is the cause.&lt;/P&gt;
&lt;P&gt;Since you only have 1352 obs in B, there's one obs in A that does not get a match, and b.appname will be missing, causing this condition to be false.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 12:52:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477057#M122808</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-11T12:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - Left Join Not Working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477067#M122809</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;and &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83078"&gt;@SuryaKiran&lt;/a&gt;- can you help me take it a step further?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now that I know this is the error (residing in the where clause), how do I tell SAS to search for the value in b.appname?&amp;nbsp; See what I mean in the example below...I changed the column names for simplicity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example and simplicity, Table A&amp;nbsp;has several obs:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;name&lt;/TD&gt;&lt;TD&gt;address&lt;/TD&gt;&lt;TD&gt;state&lt;/TD&gt;&lt;TD&gt;cars&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;john&lt;/TD&gt;&lt;TD&gt;555 jolly&lt;/TD&gt;&lt;TD&gt;ga&lt;/TD&gt;&lt;TD&gt;f150&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;mike&lt;/TD&gt;&lt;TD&gt;444 keys&lt;/TD&gt;&lt;TD&gt;fl&lt;/TD&gt;&lt;TD&gt;lexus&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;lou&lt;/TD&gt;&lt;TD&gt;333 snow&lt;/TD&gt;&lt;TD&gt;la&lt;/TD&gt;&lt;TD&gt;camry&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;harold&lt;/TD&gt;&lt;TD&gt;222 frills&lt;/TD&gt;&lt;TD&gt;ga&lt;/TD&gt;&lt;TD&gt;civic&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;greg&lt;/TD&gt;&lt;TD&gt;111 yodle&lt;/TD&gt;&lt;TD&gt;ga&lt;/TD&gt;&lt;TD&gt;pilot&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;susan&lt;/TD&gt;&lt;TD&gt;777 sleds&lt;/TD&gt;&lt;TD&gt;tx&lt;/TD&gt;&lt;TD&gt;f250&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;michelle&lt;/TD&gt;&lt;TD&gt;999 elves&lt;/TD&gt;&lt;TD&gt;sc&lt;/TD&gt;&lt;TD&gt;navigator&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table B has fewer obs:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;name&lt;/TD&gt;&lt;TD&gt;address&lt;/TD&gt;&lt;TD&gt;state&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;john&lt;/TD&gt;&lt;TD&gt;555 jolly&lt;/TD&gt;&lt;TD&gt;ga&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;greg&lt;/TD&gt;&lt;TD&gt;111 yodle&lt;/TD&gt;&lt;TD&gt;ga&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;harold&lt;/TD&gt;&lt;TD&gt;222 frills&lt;/TD&gt;&lt;TD&gt;ga&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If&amp;nbsp; the value of "state" is dynamic or changes in Table B, how do I get all instances of Table A, where Table B matches?&amp;nbsp; &amp;nbsp; I only want the values to compare when they match Table A.&amp;nbsp; This is how I would write the code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql:&lt;/P&gt;&lt;P&gt;create table test as&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; select a.*,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;b.name&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;b.state&lt;/P&gt;&lt;P&gt;from table A&lt;/P&gt;&lt;P&gt;left join table B&lt;/P&gt;&lt;P&gt;on (a.name = b.name)&lt;/P&gt;&lt;P&gt;where a.state = b.state;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But now that I know this is incorrect, how do I get all obs from table A and only those from Table B that match?&amp;nbsp; I can't simply put where a.state = "ga" because I don't have time to open Table B to see the value of state and enter it into the code.&amp;nbsp; I want SAS to do it automatically.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if Table A has 100 obs that matches state "ga" and only 10 obs that matches "ga" in table B, then I want all 100 obs and only those 10 from table B.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If Table A has 150 obs that matches&amp;nbsp;"fl" and only 40 obs that matches "fl" in table B, then I want all 150 from table A and only those from table B that match.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 13:35:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477067#M122809</guid>
      <dc:creator>belboy</dc:creator>
      <dc:date>2018-07-11T13:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - Left Join Not Working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477072#M122811</link>
      <description>&lt;P&gt;Just move the condition from the &lt;EM&gt;where&lt;/EM&gt; to the &lt;EM&gt;on&lt;/EM&gt; clause.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 13:42:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477072#M122811</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-11T13:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - Left Join Not Working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477094#M122815</link>
      <description>&lt;P&gt;Not sure what your trying to do. Can you be more specific, provide some sample data you have and the output your expecting.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 14:16:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477094#M122815</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-07-11T14:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - Left Join Not Working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477127#M122829</link>
      <description>&lt;P&gt;So this is code I created - and can be used by my entire team.&amp;nbsp; Table B is not a static table... meaning, it can be a different table (although it has the same columns) but we rename it as Table B so that we can compare it to our master table, Table A.&amp;nbsp; This is explained in detail below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, on any day, Table B could look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Ref&lt;/TD&gt;&lt;TD&gt;Appname&lt;/TD&gt;&lt;TD&gt;Role Name&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Business Friendly Description&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;SOX Critical&lt;BR /&gt;(Yes or No)&lt;/TD&gt;&lt;TD&gt;Role Composition:&lt;BR /&gt;Semicolon-separated list&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;SoD conflict:&lt;BR /&gt;Semicolon-separated list&lt;/TD&gt;&lt;TD&gt;Role Owner&lt;BR /&gt;RACF&lt;/TD&gt;&lt;TD&gt;INHERITANCE:&lt;BR /&gt;Is the role "Derived"?&lt;/TD&gt;&lt;TD&gt;If Inheritance Is Yes, What does the role Inherit From? (Semicolon separated list)&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;TD&gt;Does this Entitlement/Role grant Privileged/Elevated Access (Yes or No)&lt;/TD&gt;&lt;TD&gt;If Change, what changed?&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;OuTrade&lt;/TD&gt;&lt;TD&gt;Admin&lt;/TD&gt;&lt;TD&gt;System Admin/Support Group&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;$shisk&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;UGPS16&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;Invnrsch;Slnsast;Cimpnmts&lt;/TD&gt;&lt;TD&gt;Change&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;role composition, owner&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Clr&lt;/TD&gt;&lt;TD&gt;Clearance and Settlements Group&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;%fjskff&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;UG6R45&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Change&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;role composition&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Clsup&lt;/TD&gt;&lt;TD&gt;Client Support and Onboarding Group&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;%0custlui&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;UG6R45&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Change&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;role composition&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Clspmgr&lt;/TD&gt;&lt;TD&gt;Client Support and Pledging Manager&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;%lkscustlui&lt;/TD&gt;&lt;TD&gt;UG6R45&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Change&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;role composition&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or on another day Table B could look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Ref&lt;/TD&gt;&lt;TD&gt;Appname&lt;/TD&gt;&lt;TD&gt;Role Name&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Business Friendly Description&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;SOX Critical&lt;BR /&gt;(Yes or No)&lt;/TD&gt;&lt;TD&gt;Role Composition:&lt;BR /&gt;Semicolon-separated list&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;SoD conflict:&lt;BR /&gt;Semicolon-separated list&lt;/TD&gt;&lt;TD&gt;Role Owner&lt;BR /&gt;RACF&lt;/TD&gt;&lt;TD&gt;INHERITANCE:&lt;BR /&gt;Is the role "Derived"?&lt;/TD&gt;&lt;TD&gt;If Inheritance Is Yes, What does the role Inherit From? (Semicolon separated list)&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;TD&gt;Does this Entitlement/Role grant Privileged/Elevated Access (Yes or No)&lt;/TD&gt;&lt;TD&gt;If Change, what changed?&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;ALOPS&lt;/TD&gt;&lt;TD&gt;Admin&lt;/TD&gt;&lt;TD&gt;Client Support and Onboarding Group&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;%fjskff&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;UGPS16&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;Invnrsch;Slnsast;Cimpnmts&lt;/TD&gt;&lt;TD&gt;Change&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;role composition, owner&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Clr&lt;/TD&gt;&lt;TD&gt;Clearance and Settlements Group&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;%0custlui&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;UG6R95&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Change&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;role composition&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Admin&lt;/TD&gt;&lt;TD&gt;Client Support and Onboarding Group&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;%0custlui&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;UG6R45&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Change&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;role composition&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Admin&lt;/TD&gt;&lt;TD&gt;System Admin/Support Group&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;%lkscustlui&lt;/TD&gt;&lt;TD&gt;UGPS29&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Change&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;role composition&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&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;&lt;P&gt;Here is Table A:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Profile Application&lt;/TD&gt;&lt;TD&gt;Role&lt;/TD&gt;&lt;TD&gt;Profile Description&lt;/TD&gt;&lt;TD&gt;SoxCritical&lt;/TD&gt;&lt;TD&gt;Privileged&lt;/TD&gt;&lt;TD&gt;Owner&lt;/TD&gt;&lt;TD&gt;rolecomposition&lt;/TD&gt;&lt;TD&gt;DESCRIPTION&lt;/TD&gt;&lt;TD&gt;Conflict&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;OuTrade&lt;/TD&gt;&lt;TD&gt;Clspmgr&lt;/TD&gt;&lt;TD&gt;No Description&lt;/TD&gt;&lt;TD&gt;TRUE&lt;/TD&gt;&lt;TD&gt;TRUE&lt;/TD&gt;&lt;TD&gt;UG6R45&lt;/TD&gt;&lt;TD&gt;seldistrade&lt;/TD&gt;&lt;TD&gt;Client Support and Pledging Manager&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;OuTrade&lt;/TD&gt;&lt;TD&gt;Opsmgr&lt;/TD&gt;&lt;TD&gt;No Description&lt;/TD&gt;&lt;TD&gt;TRUE&lt;/TD&gt;&lt;TD&gt;TRUE&lt;/TD&gt;&lt;TD&gt;UG6R45&lt;/TD&gt;&lt;TD&gt;uhold&lt;/TD&gt;&lt;TD&gt;Operations Administration Group&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;OuTrade&lt;/TD&gt;&lt;TD&gt;MO&lt;/TD&gt;&lt;TD&gt;No Description&lt;/TD&gt;&lt;TD&gt;TRUE&lt;/TD&gt;&lt;TD&gt;TRUE&lt;/TD&gt;&lt;TD&gt;UG6R45&lt;/TD&gt;&lt;TD&gt;rqsttrdhist&lt;/TD&gt;&lt;TD&gt;Middle Office Group&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;OuTrade&lt;/TD&gt;&lt;TD&gt;MO&lt;/TD&gt;&lt;TD&gt;No Description&lt;/TD&gt;&lt;TD&gt;TRUE&lt;/TD&gt;&lt;TD&gt;TRUE&lt;/TD&gt;&lt;TD&gt;UG6R45&lt;/TD&gt;&lt;TD&gt;showlog&lt;/TD&gt;&lt;TD&gt;Middle Office Group&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ALOPS&lt;/TD&gt;&lt;TD&gt;Connect&lt;/TD&gt;&lt;TD&gt;No Description&lt;/TD&gt;&lt;TD&gt;FALSE&lt;/TD&gt;&lt;TD&gt;FALSE&lt;/TD&gt;&lt;TD&gt;FUS332&lt;/TD&gt;&lt;TD&gt;uhold&lt;/TD&gt;&lt;TD&gt;Middle Office Group&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ALOPS&lt;/TD&gt;&lt;TD&gt;Connect&lt;/TD&gt;&lt;TD&gt;No Description&lt;/TD&gt;&lt;TD&gt;FALSE&lt;/TD&gt;&lt;TD&gt;FALSE&lt;/TD&gt;&lt;TD&gt;UL9V42&lt;/TD&gt;&lt;TD&gt;uhold&lt;/TD&gt;&lt;TD&gt;Middle Office Group&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ALOPS&lt;/TD&gt;&lt;TD&gt;Connect&lt;/TD&gt;&lt;TD&gt;No Description&lt;/TD&gt;&lt;TD&gt;TRUE&lt;/TD&gt;&lt;TD&gt;TRUE&lt;/TD&gt;&lt;TD&gt;U4GL3F&lt;/TD&gt;&lt;TD&gt;showlog&lt;/TD&gt;&lt;TD&gt;Middle Office Group&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BXTRAN&lt;/TD&gt;&lt;TD&gt;Slimsfx&lt;/TD&gt;&lt;TD&gt;No Description&lt;/TD&gt;&lt;TD&gt;TRUE&lt;/TD&gt;&lt;TD&gt;TRUE&lt;/TD&gt;&lt;TD&gt;UF442K1&lt;/TD&gt;&lt;TD&gt;seldistrade&lt;/TD&gt;&lt;TD&gt;Operations Administration Group&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BXTRAN&lt;/TD&gt;&lt;TD&gt;Slimsfx&lt;/TD&gt;&lt;TD&gt;No Description&lt;/TD&gt;&lt;TD&gt;FALSE&lt;/TD&gt;&lt;TD&gt;TRUE&lt;/TD&gt;&lt;TD&gt;U4GL3F&lt;/TD&gt;&lt;TD&gt;seldistrade&lt;/TD&gt;&lt;TD&gt;Operations Administration Group&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BXTRAN&lt;/TD&gt;&lt;TD&gt;Slimsfx&lt;/TD&gt;&lt;TD&gt;No Description&lt;/TD&gt;&lt;TD&gt;TRUE&lt;/TD&gt;&lt;TD&gt;FALSE&lt;/TD&gt;&lt;TD&gt;U4GL3F&lt;/TD&gt;&lt;TD&gt;seldistrade&lt;/TD&gt;&lt;TD&gt;Operations Administration Group&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if on Monday my Table B looks like my first sample(above), I want all records from Table A and only those from Table B that match.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If on another day my Table B looks like my second sample above, I want all records from Table A and only those form Table B that match.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like SAS to search for all records in Table A, that equal the variable "Appname" listed in Table B, and left join Table B where there is a match.&amp;nbsp; How do I do this?&amp;nbsp; does this example help?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 15:30:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477127#M122829</guid>
      <dc:creator>belboy</dc:creator>
      <dc:date>2018-07-11T15:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - Left Join Not Working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477129#M122830</link>
      <description>&lt;P&gt;Try what I suggested (move the condition into the &lt;EM&gt;on&lt;/EM&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 15:34:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477129#M122830</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-11T15:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - Left Join Not Working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477149#M122837</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the following but my records increased to 4937 obs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;create table RoleStatusRpt as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;select a.*,&lt;BR /&gt;b.'Role Name'n,&lt;BR /&gt;b.'business friendly description'n,&lt;BR /&gt;b.rolecompfinal,&lt;BR /&gt;b.'Role Owner RACF'n,&lt;BR /&gt;b.appname,&lt;BR /&gt;b.'SoD conflict'n as SOD_Conflict,&lt;BR /&gt;b.'SOX Critical (Yes or No)'n,&lt;BR /&gt;b.'Does this Entitlement/Role grant'n,&lt;/P&gt;&lt;P&gt;case when a.role ne b.'Role Name'n then "No Match" end as RoleStatus,&lt;/P&gt;&lt;P&gt;case when a.Description ne b.'business friendly description'n&amp;nbsp;then "No Match" end as BFD_Status,&lt;/P&gt;&lt;P&gt;case when b.'SOX Critical (Yes or No)'n = "Yes" and a.soxcritical = "false" or&amp;nbsp;b.'SOX Critical (Yes or No)'n = "No" and a.soxcritical = "true" then "No Match" END AS SOXStatus,&lt;/P&gt;&lt;P&gt;case when a.rolecomposition ne b.rolecompfinal then "No Match" end as CompositionStatus,&lt;/P&gt;&lt;P&gt;case when a.conflict ne b.'SoD conflict'n then "No Match" end as SODConflictStatus,&lt;/P&gt;&lt;P&gt;case when a.owner ne b.'Role Owner RACF'n then "No Match" end as RACFOwnerStatus,&lt;/P&gt;&lt;P&gt;case when b.'Does this Entitlement/Role grant'n = "Yes" and a.privileged = "false"&amp;nbsp;then "No Match" end as PriviledgeStatus&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;from qa2.sailpoint_role_final as&amp;nbsp;a&lt;BR /&gt;left join&amp;nbsp;app as&amp;nbsp;b&lt;BR /&gt;on (a.role = b.'Role Name'n and&lt;BR /&gt;a.rolecomposition = b.rolecompfinal and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;a.owner = b.'Role Owner RACF'n and&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;a.'Profile Application'n = b.appname&lt;/SPAN&gt;)&lt;BR /&gt;/*where a.'Profile Application'n = b.appname*/&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS Log:&lt;/P&gt;&lt;P&gt;NOTE: A CASE expression has no ELSE clause. Cases not accounted for by the WHEN clauses will result in a missing value for the CASE&lt;BR /&gt;expression.&lt;BR /&gt;NOTE: A CASE expression has no ELSE clause. Cases not accounted for by the WHEN clauses will result in a missing value for the CASE&lt;BR /&gt;expression.&lt;BR /&gt;NOTE: A CASE expression has no ELSE clause. Cases not accounted for by the WHEN clauses will result in a missing value for the CASE&lt;BR /&gt;expression.&lt;BR /&gt;NOTE: A CASE expression has no ELSE clause. Cases not accounted for by the WHEN clauses will result in a missing value for the CASE&lt;BR /&gt;expression.&lt;BR /&gt;NOTE: A CASE expression has no ELSE clause. Cases not accounted for by the WHEN clauses will result in a missing value for the CASE&lt;BR /&gt;expression.&lt;BR /&gt;NOTE: A CASE expression has no ELSE clause. Cases not accounted for by the WHEN clauses will result in a missing value for the CASE&lt;BR /&gt;expression.&lt;BR /&gt;NOTE: A CASE expression has no ELSE clause. Cases not accounted for by the WHEN clauses will result in a missing value for the CASE&lt;BR /&gt;expression.&lt;BR /&gt;NOTE: Table WORK.TEST1ROLESTATUSRPT created, with 4937 rows and 24 columns.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 16:49:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477149#M122837</guid>
      <dc:creator>belboy</dc:creator>
      <dc:date>2018-07-11T16:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - Left Join Not Working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477161#M122839</link>
      <description>&lt;P&gt;Which means you have multiple matches from both datasets and get a cartesian product.&lt;/P&gt;
&lt;P&gt;Maxim 3: know your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 17:19:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477161#M122839</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-11T17:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - Left Join Not Working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477168#M122845</link>
      <description>&lt;P&gt;OK - so can't be done?&amp;nbsp; surely there has to be a way...&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 17:35:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477168#M122845</guid>
      <dc:creator>belboy</dc:creator>
      <dc:date>2018-07-11T17:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - Left Join Not Working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477183#M122852</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/92272"&gt;@belboy&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;OK - so can't be done?&amp;nbsp; surely there has to be a way...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes. Know your data. From that you can devise ways to prepare your datasets for the join so that you don' get duplicates (summing up, select distinct etc)&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 18:03:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477183#M122852</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-11T18:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - Left Join Not Working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477187#M122853</link>
      <description>&lt;P&gt;SAS community - let me know if the following makes sense.&amp;nbsp; Looking for a helpful solution.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 18:08:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477187#M122853</guid>
      <dc:creator>belboy</dc:creator>
      <dc:date>2018-07-11T18:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - Left Join Not Working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477336#M122918</link>
      <description>&lt;P&gt;Post examples for your SAS data in a usable way (data steps with datalines). See my footnotes for help in converting datasets to data steps, and how to post code.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 06:08:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477336#M122918</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-12T06:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - Left Join Not Working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477444#M122954</link>
      <description>&lt;P&gt;The solution came to me in a dream - call symput!&amp;nbsp; Having SAS assign a macro based on a variable within a data step (or in this case Proc Sql).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the code I used to solve the problem is here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;select appname&lt;BR /&gt;into :appname&lt;BR /&gt;from &amp;amp;app; quit;&lt;/P&gt;&lt;P&gt;%let appname = &amp;amp;appname;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This allowed SAS to create and assign a dynamic value to a variable that will be used later in the code.&amp;nbsp; So instead of using the incorrect method of&amp;nbsp; - where a.'# application'n = b.appname;&amp;nbsp; I added the macro to change this "where" statement into - where a.'# application'n = "&amp;amp;appname";&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps anyone else who may encounter a problem similar to this.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 13:12:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477444#M122954</guid>
      <dc:creator>belboy</dc:creator>
      <dc:date>2018-07-12T13:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - Left Join Not Working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477478#M122976</link>
      <description>&lt;P&gt;I'm glad that you found the solution. But note that this will keep only one value in the macro variable when you have multiple values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check this two approaches where there are multiple values to be accounted.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select name into: Name
from sashelp.class;
quit;

proc sql;
select * from sashelp.class
where name="&amp;amp;Name"
;
Quit;

proc sql noprint;
select quote(strip(name)) into:Name separated by ','
from sashelp.class;
quit;

proc sql;
select * from sashelp.class
where name in (&amp;amp;name)
;
Quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Jul 2018 13:57:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477478#M122976</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-07-12T13:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - Left Join Not Working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477483#M122980</link>
      <description>&lt;P&gt;The situation seems to be like that:&lt;/P&gt;
&lt;P&gt;Each new dataset only contains data for a specific group in the existing dataset. From that, I think that &lt;U&gt;adding&lt;/U&gt; the&lt;/P&gt;
&lt;PRE&gt;a.'Profile Application'n = b.appname&lt;/PRE&gt;
&lt;P&gt;to the on clause of the left join should also work. But taking the appname from the first obs of the incoming file and using that in the where will also work, as the "solved" message shows.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 14:04:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Left-Join-Not-Working/m-p/477483#M122980</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-12T14:04:04Z</dc:date>
    </item>
  </channel>
</rss>

