<?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 Where statements with &amp;quot;and&amp;quot; in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Where-statements-with-quot-and-quot/m-p/762270#M80931</link>
    <description>&lt;P&gt;Hi guys,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My data tables has about 1,000 records with the following variables:&lt;/P&gt;
&lt;P&gt;Name&lt;/P&gt;
&lt;P&gt;Age&lt;/P&gt;
&lt;P&gt;City&lt;/P&gt;
&lt;P&gt;State&lt;/P&gt;
&lt;P&gt;MonthlyBill&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using the following code to &lt;STRIKE&gt;remove&lt;/STRIKE&gt;&amp;nbsp;retain those who are from NY and pays monthly of $500 or less&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql;
create table want as
select t1.*
from have t1
where t1.state IN ('NY') 
and t1.MonthlyBill lt 500;
quit;&lt;/PRE&gt;
&lt;P&gt;I am left with 300 records and I am confused. Upon checking, my tables have about 200 NY customers and 500 are those below 500 bill. I was only expecting about 200 to be removed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any thoughts?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Aug 2021 13:18:51 GMT</pubDate>
    <dc:creator>rapt1</dc:creator>
    <dc:date>2021-08-18T13:18:51Z</dc:date>
    <item>
      <title>Where statements with "and"</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Where-statements-with-quot-and-quot/m-p/762270#M80931</link>
      <description>&lt;P&gt;Hi guys,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My data tables has about 1,000 records with the following variables:&lt;/P&gt;
&lt;P&gt;Name&lt;/P&gt;
&lt;P&gt;Age&lt;/P&gt;
&lt;P&gt;City&lt;/P&gt;
&lt;P&gt;State&lt;/P&gt;
&lt;P&gt;MonthlyBill&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using the following code to &lt;STRIKE&gt;remove&lt;/STRIKE&gt;&amp;nbsp;retain those who are from NY and pays monthly of $500 or less&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql;
create table want as
select t1.*
from have t1
where t1.state IN ('NY') 
and t1.MonthlyBill lt 500;
quit;&lt;/PRE&gt;
&lt;P&gt;I am left with 300 records and I am confused. Upon checking, my tables have about 200 NY customers and 500 are those below 500 bill. I was only expecting about 200 to be removed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any thoughts?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 13:18:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Where-statements-with-quot-and-quot/m-p/762270#M80931</guid>
      <dc:creator>rapt1</dc:creator>
      <dc:date>2021-08-18T13:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Where statements with "and"</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Where-statements-with-quot-and-quot/m-p/762277#M80932</link>
      <description>&lt;P&gt;Your description is confusing.&amp;nbsp; Your code is not "removing" anything. It is selecting just the observations that meet both criteria.&lt;/P&gt;
&lt;P&gt;So if there are only 200 NY records then the maximum number of observations you will get is 200.&amp;nbsp; If any of them have bills larger than 500 then you will get less than 200.&amp;nbsp; Remember that SAS will treat missing values as less than any actual number so your WANT dataset could include observations with missing values for monthlybill&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 13:10:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Where-statements-with-quot-and-quot/m-p/762277#M80932</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-08-18T13:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Where statements with "and"</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Where-statements-with-quot-and-quot/m-p/762279#M80933</link>
      <description>&lt;P&gt;Oh. Let me revisit my code. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 13:25:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Where-statements-with-quot-and-quot/m-p/762279#M80933</guid>
      <dc:creator>rapt1</dc:creator>
      <dc:date>2021-08-18T13:25:55Z</dc:date>
    </item>
  </channel>
</rss>

