<?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: Exclude using a combination of variables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Exclude-using-a-combination-of-variables/m-p/38094#M9724</link>
    <description>Need an "OR" not "AND" in the where statement. &lt;BR /&gt;
&lt;BR /&gt;
data LIST;&lt;BR /&gt;
input ID Style CD $ NUM;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 102 A 12&lt;BR /&gt;
2 102 C 14&lt;BR /&gt;
3 104 A 12&lt;BR /&gt;
4 104 A 13&lt;BR /&gt;
5 104 B 14&lt;BR /&gt;
6 104 B 12&lt;BR /&gt;
7 104 C 12&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
PROC PRINT DATA = LIST noobs; &lt;BR /&gt;
where style = 104 and (cd ne 'A' OR num ne 12);&lt;BR /&gt;
RUN;</description>
    <pubDate>Mon, 22 Nov 2010 17:17:36 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2010-11-22T17:17:36Z</dc:date>
    <item>
      <title>Exclude using a combination of variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Exclude-using-a-combination-of-variables/m-p/38093#M9723</link>
      <description>I’m trying to select records based on a variable (Style) but I also want to exclude some of those records based on 2 other variables. &lt;BR /&gt;
From my test data, I would like all style 104 except those with CD = ‘A’ and Num = 12. &lt;BR /&gt;
Desired results ID 4,5,6,7  &lt;BR /&gt;
&lt;BR /&gt;
data LIST;&lt;BR /&gt;
input ID Style CD $ NUM;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 102 A 12&lt;BR /&gt;
2 102 C 14&lt;BR /&gt;
3 104 A 12&lt;BR /&gt;
4 104 A 13&lt;BR /&gt;
5 104 B 14&lt;BR /&gt;
6 104 B 12&lt;BR /&gt;
7 104 C 12&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
PROC PRINT DATA = LIST noobs; &lt;BR /&gt;
where style = 104 and (cd ne 'A' and num ne 12);&lt;BR /&gt;
RUN;&lt;BR /&gt;
/* only returning ID 5 */</description>
      <pubDate>Mon, 22 Nov 2010 17:13:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Exclude-using-a-combination-of-variables/m-p/38093#M9723</guid>
      <dc:creator>markjc</dc:creator>
      <dc:date>2010-11-22T17:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude using a combination of variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Exclude-using-a-combination-of-variables/m-p/38094#M9724</link>
      <description>Need an "OR" not "AND" in the where statement. &lt;BR /&gt;
&lt;BR /&gt;
data LIST;&lt;BR /&gt;
input ID Style CD $ NUM;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 102 A 12&lt;BR /&gt;
2 102 C 14&lt;BR /&gt;
3 104 A 12&lt;BR /&gt;
4 104 A 13&lt;BR /&gt;
5 104 B 14&lt;BR /&gt;
6 104 B 12&lt;BR /&gt;
7 104 C 12&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
PROC PRINT DATA = LIST noobs; &lt;BR /&gt;
where style = 104 and (cd ne 'A' OR num ne 12);&lt;BR /&gt;
RUN;</description>
      <pubDate>Mon, 22 Nov 2010 17:17:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Exclude-using-a-combination-of-variables/m-p/38094#M9724</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2010-11-22T17:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude using a combination of variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Exclude-using-a-combination-of-variables/m-p/38095#M9725</link>
      <description>Thank you!&lt;BR /&gt;
Using the OR with a not equal makes sense but I wasn't seeing it because I kept thinking you need to be 'A' and 12.</description>
      <pubDate>Mon, 22 Nov 2010 17:54:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Exclude-using-a-combination-of-variables/m-p/38095#M9725</guid>
      <dc:creator>markjc</dc:creator>
      <dc:date>2010-11-22T17:54:25Z</dc:date>
    </item>
  </channel>
</rss>

