<?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: subsetting with the use of where and upcase function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/subsetting-with-the-use-of-where-and-upcase-function/m-p/754078#M237739</link>
    <description>&lt;P&gt;Your first set of code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where upcase(drivetrain)="FRONT";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that DRIVETRAIN and FRONT are both upcased in this filter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your second set of code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where drivetrain=upcase("front");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In this one FRONT is upcased but we don't know if DRIVETRAIN is, unless it was done previously. Given the results, it seems like it's not upcased so both sides of your equal signs are not the same. You could be comparing "Front" to "FRONT" which will not match.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/357033"&gt;@Karim18&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;data cars_subset;&lt;BR /&gt;set sashelp.cars;&lt;BR /&gt;where upcase(drivetrain)="FRONT";&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;data cars_subset;&lt;BR /&gt;set sashelp.cars;&lt;BR /&gt;where drivetrain=upcase("front");&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;first one produces 226 obs and 15 columns&lt;/P&gt;
&lt;P&gt;and second one produces 0 obs and 15 columns&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;why it produces two different results ??&lt;/P&gt;
&lt;P&gt;and please brief me about how upcase function works like this situation?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jul 2021 14:19:09 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-07-14T14:19:09Z</dc:date>
    <item>
      <title>subsetting with the use of where and upcase function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/subsetting-with-the-use-of-where-and-upcase-function/m-p/754073#M237735</link>
      <description>&lt;P&gt;&lt;BR /&gt;data cars_subset;&lt;BR /&gt;set sashelp.cars;&lt;BR /&gt;where upcase(drivetrain)="FRONT";&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;data cars_subset;&lt;BR /&gt;set sashelp.cars;&lt;BR /&gt;where drivetrain=upcase("front");&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;first one produces 226 obs and 15 columns&lt;/P&gt;&lt;P&gt;and second one produces 0 obs and 15 columns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;why it produces two different results ??&lt;/P&gt;&lt;P&gt;and please brief me about how upcase function works like this situation?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 14:10:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/subsetting-with-the-use-of-where-and-upcase-function/m-p/754073#M237735</guid>
      <dc:creator>Karim18</dc:creator>
      <dc:date>2021-07-14T14:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: subsetting with the use of where and upcase function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/subsetting-with-the-use-of-where-and-upcase-function/m-p/754077#M237738</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/357033"&gt;@Karim18&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The value of the variable DRIVETRAIN in the CLASS data set is "Front".&lt;/P&gt;
&lt;P&gt;If you upcase the variable value the result is "FRONT", so the first comparison is true.&lt;/P&gt;
&lt;P&gt;But in the second comparison the original variable value "Front" is compared to upcase("front"), also ti "FRONT", which is false.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 14:16:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/subsetting-with-the-use-of-where-and-upcase-function/m-p/754077#M237738</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2021-07-14T14:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: subsetting with the use of where and upcase function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/subsetting-with-the-use-of-where-and-upcase-function/m-p/754078#M237739</link>
      <description>&lt;P&gt;Your first set of code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where upcase(drivetrain)="FRONT";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that DRIVETRAIN and FRONT are both upcased in this filter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your second set of code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where drivetrain=upcase("front");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In this one FRONT is upcased but we don't know if DRIVETRAIN is, unless it was done previously. Given the results, it seems like it's not upcased so both sides of your equal signs are not the same. You could be comparing "Front" to "FRONT" which will not match.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/357033"&gt;@Karim18&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;data cars_subset;&lt;BR /&gt;set sashelp.cars;&lt;BR /&gt;where upcase(drivetrain)="FRONT";&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;data cars_subset;&lt;BR /&gt;set sashelp.cars;&lt;BR /&gt;where drivetrain=upcase("front");&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;first one produces 226 obs and 15 columns&lt;/P&gt;
&lt;P&gt;and second one produces 0 obs and 15 columns&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;why it produces two different results ??&lt;/P&gt;
&lt;P&gt;and please brief me about how upcase function works like this situation?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 14:19:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/subsetting-with-the-use-of-where-and-upcase-function/m-p/754078#M237739</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-07-14T14:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: subsetting with the use of where and upcase function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/subsetting-with-the-use-of-where-and-upcase-function/m-p/754103#M237750</link>
      <description>sir upcase function manipulates data in execution phase and where statemt is compiled time statement&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;then how come it changes to uppercase???&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Jul 2021 15:09:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/subsetting-with-the-use-of-where-and-upcase-function/m-p/754103#M237750</guid>
      <dc:creator>Karim18</dc:creator>
      <dc:date>2021-07-14T15:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: subsetting with the use of where and upcase function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/subsetting-with-the-use-of-where-and-upcase-function/m-p/754116#M237755</link>
      <description>Timing of when something happens doesn't matter in this particular situation, it has to do with the values not matching.</description>
      <pubDate>Wed, 14 Jul 2021 15:27:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/subsetting-with-the-use-of-where-and-upcase-function/m-p/754116#M237755</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-07-14T15:27:51Z</dc:date>
    </item>
  </channel>
</rss>

