<?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: Joins in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Joins/m-p/757964#M239288</link>
    <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;Appreciate it.&lt;/P&gt;&lt;P&gt;How will I address this issue if not inner join&lt;/P&gt;&lt;P&gt;I have 2 tables A and B&lt;/P&gt;&lt;P&gt;A has Vehicle,Bus,Train&lt;/P&gt;&lt;P&gt;B has Vehicle,road,car&lt;/P&gt;&lt;P&gt;In B table I need only Toyota , camry from car variable&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can join these tables by vehicle as an common variable&amp;nbsp;&lt;/P&gt;&lt;P&gt;How should I approach this condition?&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jul 2021 23:46:12 GMT</pubDate>
    <dc:creator>sasenthusiast07</dc:creator>
    <dc:date>2021-07-28T23:46:12Z</dc:date>
    <item>
      <title>Joins</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Joins/m-p/757960#M239285</link>
      <description>&lt;P&gt;Good evening all,&lt;/P&gt;
&lt;P&gt;I have an question in inner join ,&lt;/P&gt;
&lt;P&gt;I have performed inner join like this&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;

create table combine as

select distinct

n.apple,

p.vegges

from&amp;nbsp;

fruits as n

inner join&amp;nbsp;

vegetables as p

on&amp;nbsp;

n.key=p.key;

quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now in vegges column I have carrots,beans,brocoli,beets--I like my data only to have carrot and beans , how will I apply this condition here.&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;S&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 23:51:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Joins/m-p/757960#M239285</guid>
      <dc:creator>sasenthusiast07</dc:creator>
      <dc:date>2021-07-28T23:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Joins</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Joins/m-p/757962#M239286</link>
      <description>&lt;P&gt;You probably just need a WHERE clause just before the semi-colon.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;WHERE vegge IN (carrot, beans)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However, remember that if you're doing an Inner join, only items found in&amp;nbsp;&lt;STRONG&gt;both&amp;nbsp;&lt;/STRONG&gt;tables will be present in the results set.&amp;nbsp; I'm not sure that carrot or beans will be found in an Inner join with fruits.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 23:36:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Joins/m-p/757962#M239286</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-07-28T23:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: Joins</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Joins/m-p/757964#M239288</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;Appreciate it.&lt;/P&gt;&lt;P&gt;How will I address this issue if not inner join&lt;/P&gt;&lt;P&gt;I have 2 tables A and B&lt;/P&gt;&lt;P&gt;A has Vehicle,Bus,Train&lt;/P&gt;&lt;P&gt;B has Vehicle,road,car&lt;/P&gt;&lt;P&gt;In B table I need only Toyota , camry from car variable&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can join these tables by vehicle as an common variable&amp;nbsp;&lt;/P&gt;&lt;P&gt;How should I approach this condition?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 23:46:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Joins/m-p/757964#M239288</guid>
      <dc:creator>sasenthusiast07</dc:creator>
      <dc:date>2021-07-28T23:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Joins</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Joins/m-p/757966#M239289</link>
      <description>The question is, what do you want to happen if that value is not in both tables? What do you want as the output? INNER join only works if it's both tables, if it's one and not the other then you would need to use a LEFT/RIGHT JOIN. Personally, I almost never use an INNER join, I use right/left instead that way if missing values are present they would have missing values and it's an obvious error that's easier to notice. If you use an inner join and accidentally drop a category that's much harder to know.</description>
      <pubDate>Wed, 28 Jul 2021 23:54:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Joins/m-p/757966#M239289</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-07-28T23:54:18Z</dc:date>
    </item>
  </channel>
</rss>

