<?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 Subsetting by multiple conditions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-by-multiple-conditions/m-p/880803#M348017</link>
    <description>&lt;P&gt;&lt;SPAN&gt;What is the value of &lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;Common_Names &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;in row one? I encountered this problem and I am not sure I understand what value is required. below is the code.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;libname out "~/EPG1V2/output";&lt;BR /&gt;*libname out "~/EPG194/output";&lt;/P&gt;&lt;P&gt;data out.fox;&lt;BR /&gt;set pg1.np_species;&lt;BR /&gt;where Category='Mammal' and Common_Names like&lt;BR /&gt;'%Fox%' and Common_Names not like&lt;BR /&gt;'%Squirrel%';&lt;BR /&gt;drop Category Record_Status Occurrence Nativeness;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jun 2023 20:18:25 GMT</pubDate>
    <dc:creator>Nelson12</dc:creator>
    <dc:date>2023-06-14T20:18:25Z</dc:date>
    <item>
      <title>Subsetting by multiple conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-by-multiple-conditions/m-p/880803#M348017</link>
      <description>&lt;P&gt;&lt;SPAN&gt;What is the value of &lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;Common_Names &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;in row one? I encountered this problem and I am not sure I understand what value is required. below is the code.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;libname out "~/EPG1V2/output";&lt;BR /&gt;*libname out "~/EPG194/output";&lt;/P&gt;&lt;P&gt;data out.fox;&lt;BR /&gt;set pg1.np_species;&lt;BR /&gt;where Category='Mammal' and Common_Names like&lt;BR /&gt;'%Fox%' and Common_Names not like&lt;BR /&gt;'%Squirrel%';&lt;BR /&gt;drop Category Record_Status Occurrence Nativeness;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 20:18:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-by-multiple-conditions/m-p/880803#M348017</guid>
      <dc:creator>Nelson12</dc:creator>
      <dc:date>2023-06-14T20:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting by multiple conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-by-multiple-conditions/m-p/880807#M348021</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Not sure what you mean here.&amp;nbsp; The percent is a wildcard that says match any character, so your WHERE below is checking to see if the variable COMMON_NAMES contains a string that has Fox or does not contain the string Squirrel.&amp;nbsp; Using the wildcard means that aFoxb would be accepted.&amp;nbsp; If this is not what you are looking for, please explain further.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;where Category='Mammal' and Common_Names like&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'%Fox%' and Common_Names not like&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'%Squirrel%';&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 20:26:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-by-multiple-conditions/m-p/880807#M348021</guid>
      <dc:creator>russt_sas</dc:creator>
      <dc:date>2023-06-14T20:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting by multiple conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-by-multiple-conditions/m-p/880815#M348027</link>
      <description>&lt;P&gt;WE don't have your data set. Even if we did there is a chance that your have sorted the data set. So questions about "row one" are a bit difficult to answer. And row one from the input set or the output data set?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The conditions are saying the output values should come from Category='Mammal' (remove category from the Drop statement to see the variable in the output set) with Common_names containing "Fox" &lt;STRONG&gt;and&lt;/STRONG&gt; not containing "Squirrel". So you might have values of Common_names like "Red Fox" "Gray Fox"&amp;nbsp; but should not see "Fox Squirrel" (or "Squirrel Fox")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you run the code? What did the output look like? (Proc Print data=out.fox;run; if you don't know how to print yet)&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 20:39:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-by-multiple-conditions/m-p/880815#M348027</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-06-14T20:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting by multiple conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-by-multiple-conditions/m-p/880834#M348030</link>
      <description>I got the point now. Thank You</description>
      <pubDate>Wed, 14 Jun 2023 22:20:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-by-multiple-conditions/m-p/880834#M348030</guid>
      <dc:creator>Nelson12</dc:creator>
      <dc:date>2023-06-14T22:20:36Z</dc:date>
    </item>
  </channel>
</rss>

