<?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: Questions about Level 2 Practice: Subsetting by Multiple Conditions and Creating a Sorted SAS ta in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Questions-about-Level-2-Practice-Subsetting-by-Multiple/m-p/556298#M9802</link>
    <description>Here are some clues to get you moving.&lt;BR /&gt;&lt;BR /&gt;When examining character strings, capitalization matters.  These 3 strings are all different:&lt;BR /&gt;&lt;BR /&gt;Mammal&lt;BR /&gt;MAMMAL &lt;BR /&gt;mammal&lt;BR /&gt;&lt;BR /&gt;Similarly, these 3 are all different:&lt;BR /&gt;&lt;BR /&gt;Fox&lt;BR /&gt;FOX&lt;BR /&gt;fox&lt;BR /&gt;&lt;BR /&gt;On a related note, when you apply the UPCASE function to a character string, there is no way the result can contain a lowercase letter.</description>
    <pubDate>Sun, 05 May 2019 21:07:29 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2019-05-05T21:07:29Z</dc:date>
    <item>
      <title>Questions about Level 2 Practice: Subsetting by Multiple Conditions and Creating a Sorted SAS table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Questions-about-Level-2-Practice-Subsetting-by-Multiple/m-p/556239#M9783</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Please help me with Lesson4 Reading and Filtering data_level 2 practice. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;These are the following instructions.&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;Write a DATA step to read the &lt;STRONG&gt;np_species table&lt;/STRONG&gt; and create a new table named &lt;STRONG&gt;fox&lt;/STRONG&gt; as a permanent table in the &lt;STRONG&gt;EPG194/output&lt;/STRONG&gt; folder.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Include only the rows where &lt;STRONG&gt;Category&lt;/STRONG&gt; is Mammal and &lt;STRONG&gt;Common_Names&lt;/STRONG&gt; includes Fox in any case.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Exclude the &lt;STRONG&gt;Category&lt;/STRONG&gt;,&lt;STRONG&gt; Record_Status&lt;/STRONG&gt;,&lt;STRONG&gt; Occurrence&lt;/STRONG&gt;, and &lt;STRONG&gt;Nativeness &lt;/STRONG&gt;columns from the output data.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Add the condition in the WHERE statement to exclude rows that include Squirrel. &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Submit the program.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt; My Answer&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fox;
	set pg1.np_species;
	where Category="mammal" and upcase(Common_Names) like '%fox%'
	and upcase(Common_Names) not like '%squirrel%';
	drop Category Record_Status Occurrence Nativeness;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Q1&amp;gt; When I&amp;nbsp; run this code, the LOG says that "There were 0 observations read from the data set PG1.NP_Species". (Please refer to the box below). I wrote my code exactly the same as the answer provided. I don't know why there are 0 observations.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: There were 0 observations read from the data set PG1.NP_SPECIES.
       WHERE (Category='mammal') and UPCASE(Common_Names) like '%fox%' and UPCASE(Common_NAmes) not like '%squirrel%';
 NOTE: The data set WORK.FOX has 0 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.49 seconds
       cpu time            0.24 seconds&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Q2&amp;gt; I'm confused when to use single quotes or double quotes around the text string when using the LIKE operator. In this question, the answer explained that I must use single quotes because % symbols enclosed in double quotes invoke macro language. I don't understand what this means.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please answer these questions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2019 07:34:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Questions-about-Level-2-Practice-Subsetting-by-Multiple/m-p/556239#M9783</guid>
      <dc:creator>easthill93</dc:creator>
      <dc:date>2019-05-05T07:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Questions about Level 2 Practice: Subsetting by Multiple Conditions and Creating a Sorted SAS ta</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Questions-about-Level-2-Practice-Subsetting-by-Multiple/m-p/556266#M9790</link>
      <description>&lt;P&gt;did you assign the library PG1 when you started SAS?&lt;/P&gt;
&lt;P&gt;you have to run the libname assignment or put it into you autoexec file each time you start SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think that was in the first assignments about setting up the library each time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2019 14:41:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Questions-about-Level-2-Practice-Subsetting-by-Multiple/m-p/556266#M9790</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-05-05T14:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Questions about Level 2 Practice: Subsetting by Multiple Conditions and Creating a Sorted SAS ta</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Questions-about-Level-2-Practice-Subsetting-by-Multiple/m-p/556298#M9802</link>
      <description>Here are some clues to get you moving.&lt;BR /&gt;&lt;BR /&gt;When examining character strings, capitalization matters.  These 3 strings are all different:&lt;BR /&gt;&lt;BR /&gt;Mammal&lt;BR /&gt;MAMMAL &lt;BR /&gt;mammal&lt;BR /&gt;&lt;BR /&gt;Similarly, these 3 are all different:&lt;BR /&gt;&lt;BR /&gt;Fox&lt;BR /&gt;FOX&lt;BR /&gt;fox&lt;BR /&gt;&lt;BR /&gt;On a related note, when you apply the UPCASE function to a character string, there is no way the result can contain a lowercase letter.</description>
      <pubDate>Sun, 05 May 2019 21:07:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Questions-about-Level-2-Practice-Subsetting-by-Multiple/m-p/556298#M9802</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-05-05T21:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Questions about Level 2 Practice: Subsetting by Multiple Conditions and Creating a Sorted SAS ta</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Questions-about-Level-2-Practice-Subsetting-by-Multiple/m-p/556359#M9816</link>
      <description>&lt;P&gt;Yes. I run the libname assignment so that I have PG1 file in My Libraries before I start to write code.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 08:04:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Questions-about-Level-2-Practice-Subsetting-by-Multiple/m-p/556359#M9816</guid>
      <dc:creator>easthill93</dc:creator>
      <dc:date>2019-05-06T08:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Questions about Level 2 Practice: Subsetting by Multiple Conditions and Creating a Sorted SAS ta</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Questions-about-Level-2-Practice-Subsetting-by-Multiple/m-p/556363#M9817</link>
      <description>&lt;P&gt;I solved it!&amp;nbsp;&lt;/P&gt;&lt;P&gt;It turned out that my WHERE statement was incorrect.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;Previous Answer&amp;gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fox;
	set pg1.np_species;
	where Category="Mammal" and &lt;FONT color="#0000FF"&gt;upcase(Common_Names) like '%fox%'&lt;/FONT&gt; and 
    &lt;FONT color="#0000FF"&gt;upcase(Common_Names) not like '%squirrel%'&lt;/FONT&gt;;
	drop Category Record_Status Occurrence Nativeness;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;lt;Revised Answer&amp;gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fox;
	set pg1.np_species;
	where Category="Mammal" and &lt;FONT color="#FF00FF"&gt;Common_Names like '%Fox%'&lt;/FONT&gt; and 
    &lt;FONT color="#FF00FF"&gt;Common_Names not like '%Squirrel%'&lt;/FONT&gt;;
	drop Category Record_Status Occurrence Nativeness;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I changed the part that Common_Names include Fox in any case and exclude Squirrel in the WHERE statement.&lt;/P&gt;&lt;P&gt;Thank you very much for your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 08:25:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Questions-about-Level-2-Practice-Subsetting-by-Multiple/m-p/556363#M9817</guid>
      <dc:creator>easthill93</dc:creator>
      <dc:date>2019-05-06T08:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Questions about Level 2 Practice: Subsetting by Multiple Conditions and Creating a Sorted SAS ta</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Questions-about-Level-2-Practice-Subsetting-by-Multiple/m-p/556364#M9818</link>
      <description>&lt;P&gt;I understood.&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 08:26:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Questions-about-Level-2-Practice-Subsetting-by-Multiple/m-p/556364#M9818</guid>
      <dc:creator>easthill93</dc:creator>
      <dc:date>2019-05-06T08:26:19Z</dc:date>
    </item>
  </channel>
</rss>

