<?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 with IN operator in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Where-statement-with-IN-operator/m-p/11150#M1231</link>
    <description>SELECT clause will not work in a Data step.&lt;BR /&gt;
&lt;BR /&gt;
If you want to use the SELECT clause, you have to do this in PROC SQL.</description>
    <pubDate>Fri, 10 Jun 2011 16:20:26 GMT</pubDate>
    <dc:creator>Paige</dc:creator>
    <dc:date>2011-06-10T16:20:26Z</dc:date>
    <item>
      <title>Where statement with IN operator</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Where-statement-with-IN-operator/m-p/11149#M1230</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
Actually I want to sub set my data with the following program&lt;BR /&gt;
&lt;BR /&gt;
data final.abc;&lt;BR /&gt;
set abc;&lt;BR /&gt;
where date = '30Dec2010" d and customerNo in (select custno. from salesdata);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data set abc and and data set salesdata both exist in as a temporary data set.&lt;BR /&gt;
I want to sub set the data not only by date (a variable in dataset abc) but also by CustomerNo( also a variable in data set abc) by setting its value equal to Custno. ( a variable in another dataset salesdata).&lt;BR /&gt;
&lt;BR /&gt;
Can somebody please check the syntax  for sas, as I am unable to run this command.&lt;BR /&gt;
&lt;BR /&gt;
regards&lt;BR /&gt;
Mars</description>
      <pubDate>Fri, 10 Jun 2011 16:17:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Where-statement-with-IN-operator/m-p/11149#M1230</guid>
      <dc:creator>MARS</dc:creator>
      <dc:date>2011-06-10T16:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Where statement with IN operator</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Where-statement-with-IN-operator/m-p/11150#M1231</link>
      <description>SELECT clause will not work in a Data step.&lt;BR /&gt;
&lt;BR /&gt;
If you want to use the SELECT clause, you have to do this in PROC SQL.</description>
      <pubDate>Fri, 10 Jun 2011 16:20:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Where-statement-with-IN-operator/m-p/11150#M1231</guid>
      <dc:creator>Paige</dc:creator>
      <dc:date>2011-06-10T16:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Where statement with IN operator</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Where-statement-with-IN-operator/m-p/11151#M1232</link>
      <description>The SAS PROC SQL documentation has examples for generating a macro variable data-string for a WHERE &lt;VARNAME&gt; IN (&lt;SELECTION_LIST&gt;) as you have suggested.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
generate where statement in string using proc sql select into site:sas.com&lt;/SELECTION_LIST&gt;&lt;/VARNAME&gt;</description>
      <pubDate>Fri, 10 Jun 2011 16:53:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Where-statement-with-IN-operator/m-p/11151#M1232</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2011-06-10T16:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Where statement with IN operator</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Where-statement-with-IN-operator/m-p/11152#M1233</link>
      <description>Hello Mars,&lt;BR /&gt;
&lt;BR /&gt;
You need something like this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc SQL;&lt;BR /&gt;
  create table final.abc as&lt;BR /&gt;
  select a.*,b.* /* list all variables you need from two datasets */  &lt;BR /&gt;
  from abc as a, salesdata as b &lt;BR /&gt;
  where a.date='30Dec2010'd and a.customerNo=b.Custno&lt;BR /&gt;
;quit;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Fri, 10 Jun 2011 19:23:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Where-statement-with-IN-operator/m-p/11152#M1233</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2011-06-10T19:23:47Z</dc:date>
    </item>
  </channel>
</rss>

