<?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 : inner and left join in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-inner-and-left-join/m-p/908468#M358494</link>
    <description>Thank you, Tom</description>
    <pubDate>Sat, 16 Dec 2023 10:58:52 GMT</pubDate>
    <dc:creator>SASdevAnneMarie</dc:creator>
    <dc:date>2023-12-16T10:58:52Z</dc:date>
    <item>
      <title>proc sql : inner and left join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-inner-and-left-join/m-p/907409#M358189</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code is&amp;nbsp; :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table test as select distinct
		ev0_2.POLICE,
		ev0_2.SUPPORT,
		ev0_2.SUPPORT2,
		ev1.EFFET as EF
	from 
		(select ev0.NO_POLICE, sup.SUPPORT,sup.SUPPORT2
			from  EVEN ev0 inner join SUPPORT sup on  ev0.SUPPORT=sup.SUPPORT ) ev0_2
				left join EV ev1 on ev0_2.POLICE=ev1.NO_POLICE and ev0_2.SUPPORT=ev1.SUPPORT;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Firstly, I would like to check the common observation from the table EVEN and SUPPORT and after I would like the observation with left join. Could you please check if my code is right beacause my programme is looping.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you !&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 21:45:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-inner-and-left-join/m-p/907409#M358189</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2023-12-11T21:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql : inner and left join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-inner-and-left-join/m-p/907429#M358190</link>
      <description>&lt;P&gt;You are referencing a non-existent variable.&lt;/P&gt;
&lt;P&gt;In the sub-query you select&amp;nbsp;ev0.NO_POLICE but in the outer query you are looking for a variable named POLICE without the NO_ prefix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How many values of SUPPORT are there in the three datasets?&lt;/P&gt;
&lt;P&gt;How many observations per value of SUPPORT?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If for a single value of SUPPORT you join N observations from EVO with M observation from SUP you will get N*M observation.&amp;nbsp; If you then join that with Q observations for that value of SUPPORT from EV1 you will end up with N*M*Q observation.&amp;nbsp; Which could be a really big number.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 22:15:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-inner-and-left-join/m-p/907429#M358190</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-12-11T22:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql : inner and left join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-inner-and-left-join/m-p/908468#M358494</link>
      <description>Thank you, Tom</description>
      <pubDate>Sat, 16 Dec 2023 10:58:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-inner-and-left-join/m-p/908468#M358494</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2023-12-16T10:58:52Z</dc:date>
    </item>
  </channel>
</rss>

