<?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: how to use where statement? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/how-to-use-where-statement/m-p/656470#M22577</link>
    <description>&lt;P&gt;A variable is a variable is a variable, not "a where".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The most simple WHERE condition is usually a comparison of a variable with a literal value, like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where country = 'USA';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Your code also does not need the first data step, you can reference sasuser.acities directly in the second step.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jun 2020 16:27:51 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-06-10T16:27:51Z</dc:date>
    <item>
      <title>how to use where statement?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-use-where-statement/m-p/656467#M22576</link>
      <description>&lt;P&gt;i am a basic SAS learner. how to use where statement, when the variable it self as a where.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data task1;&lt;BR /&gt;set sasuser.Acities;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data task2;&lt;BR /&gt;set task1;&lt;BR /&gt;where 'Country where Aiport is located' = 'USA';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 16:21:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-use-where-statement/m-p/656467#M22576</guid>
      <dc:creator>Raj00007</dc:creator>
      <dc:date>2020-06-10T16:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to use where statement?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-use-where-statement/m-p/656470#M22577</link>
      <description>&lt;P&gt;A variable is a variable is a variable, not "a where".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The most simple WHERE condition is usually a comparison of a variable with a literal value, like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where country = 'USA';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Your code also does not need the first data step, you can reference sasuser.acities directly in the second step.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 16:27:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-use-where-statement/m-p/656470#M22577</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-06-10T16:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to use where statement?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-use-where-statement/m-p/656471#M22578</link>
      <description>&lt;P&gt;As written, your comparison of&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where 'Country where Aiport is located' = 'USA';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will always fail because the text string&amp;nbsp;&lt;SPAN&gt;'Country where Aiport is located' is never equal to the text string 'USA'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I think what you might want is a variable name instead of the text string&amp;nbsp;'Country where Aiport is located', but only you know what that variable name would be. I use "variablename" as the variable name, of course you would use the actual variable name.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data task1;
set sasuser.Acities;
where variablename = 'USA';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 16:28:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-use-where-statement/m-p/656471#M22578</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-10T16:28:21Z</dc:date>
    </item>
  </channel>
</rss>

