<?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: where statement when a variable equals another variable in different dataset in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/where-statement-when-a-variable-equals-another-variable-in/m-p/210793#M52105</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You end up needing a subquery:&lt;/P&gt;&lt;P&gt;WHERE VAR IN (SELECT VAR from TABLE2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table a as &lt;/P&gt;&lt;P&gt;select * &lt;/P&gt;&lt;P&gt;from table b&lt;/P&gt;&lt;P&gt;where id in (Select id from table c);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 21 Jun 2015 05:58:54 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-06-21T05:58:54Z</dc:date>
    <item>
      <title>where statement when a variable equals another variable in different dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/where-statement-when-a-variable-equals-another-variable-in/m-p/210792#M52104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I have two datasets, named Original and New. I want to create a subset of Original in which the values of the variable XXX are equal to variable YYY in dataset New.&lt;/P&gt;&lt;P&gt;I think it should be similar to where command but I don't know how to create such subset.&lt;/P&gt;&lt;P&gt;I appreciate your suggestions in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jun 2015 04:49:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/where-statement-when-a-variable-equals-another-variable-in/m-p/210792#M52104</guid>
      <dc:creator>m1986MM</dc:creator>
      <dc:date>2015-06-21T04:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: where statement when a variable equals another variable in different dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/where-statement-when-a-variable-equals-another-variable-in/m-p/210793#M52105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You end up needing a subquery:&lt;/P&gt;&lt;P&gt;WHERE VAR IN (SELECT VAR from TABLE2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table a as &lt;/P&gt;&lt;P&gt;select * &lt;/P&gt;&lt;P&gt;from table b&lt;/P&gt;&lt;P&gt;where id in (Select id from table c);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jun 2015 05:58:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/where-statement-when-a-variable-equals-another-variable-in/m-p/210793#M52105</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-06-21T05:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: where statement when a variable equals another variable in different dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/where-statement-when-a-variable-equals-another-variable-in/m-p/210794#M52106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the&amp;nbsp; merge also for the desired result .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want.&lt;/P&gt;&lt;P&gt;merge a (in = a )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b (in = b) ;&lt;/P&gt;&lt;P&gt;by id&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;if a and b ;&lt;/P&gt;&lt;P&gt;if xxx = yyy ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 13:39:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/where-statement-when-a-variable-equals-another-variable-in/m-p/210794#M52106</guid>
      <dc:creator>naveen20jan</dc:creator>
      <dc:date>2015-06-22T13:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: where statement when a variable equals another variable in different dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/where-statement-when-a-variable-equals-another-variable-in/m-p/210795#M52107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 15:35:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/where-statement-when-a-variable-equals-another-variable-in/m-p/210795#M52107</guid>
      <dc:creator>m1986MM</dc:creator>
      <dc:date>2015-06-22T15:35:29Z</dc:date>
    </item>
  </channel>
</rss>

