<?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 If and Where statements in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/If-and-Where-statements/m-p/796289#M32972</link>
    <description>&lt;P&gt;I'm trying to only keep certain observations in my data set, but when I do the IF statements, it is reporting no observations. Basically, I only want to keep observations that are considered confirmatory or presumptive, but I get the SAS error below. Why is it converting the column to numeric?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data All;&lt;BR /&gt;set xx;&lt;BR /&gt;If Highest_Evidence eq 'Confirmatory' or 'Presumptive';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CatPaws_0-1644938425540.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68484i0E0F7F96D92895ED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CatPaws_0-1644938425540.png" alt="CatPaws_0-1644938425540.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Feb 2022 15:22:07 GMT</pubDate>
    <dc:creator>CatPaws</dc:creator>
    <dc:date>2022-02-15T15:22:07Z</dc:date>
    <item>
      <title>If and Where statements</title>
      <link>https://communities.sas.com/t5/New-SAS-User/If-and-Where-statements/m-p/796289#M32972</link>
      <description>&lt;P&gt;I'm trying to only keep certain observations in my data set, but when I do the IF statements, it is reporting no observations. Basically, I only want to keep observations that are considered confirmatory or presumptive, but I get the SAS error below. Why is it converting the column to numeric?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data All;&lt;BR /&gt;set xx;&lt;BR /&gt;If Highest_Evidence eq 'Confirmatory' or 'Presumptive';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CatPaws_0-1644938425540.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68484i0E0F7F96D92895ED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CatPaws_0-1644938425540.png" alt="CatPaws_0-1644938425540.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 15:22:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/If-and-Where-statements/m-p/796289#M32972</guid>
      <dc:creator>CatPaws</dc:creator>
      <dc:date>2022-02-15T15:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: If and Where statements</title>
      <link>https://communities.sas.com/t5/New-SAS-User/If-and-Where-statements/m-p/796292#M32973</link>
      <description>&lt;P&gt;Your variable seem to be numeriv, but you are using strings in you comparison - hence no match.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 15:28:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/If-and-Where-statements/m-p/796292#M32973</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2022-02-15T15:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: If and Where statements</title>
      <link>https://communities.sas.com/t5/New-SAS-User/If-and-Where-statements/m-p/796298#M32976</link>
      <description>&lt;P&gt;When I do them separately, it runs correctly, it's just when I put them together in the same statement I get the error.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 15:33:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/If-and-Where-statements/m-p/796298#M32976</guid>
      <dc:creator>CatPaws</dc:creator>
      <dc:date>2022-02-15T15:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: If and Where statements</title>
      <link>https://communities.sas.com/t5/New-SAS-User/If-and-Where-statements/m-p/796300#M32977</link>
      <description>&lt;P&gt;You can't put them together like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;If Highest_Evidence eq 'Confirmatory' or 'Presumptive';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This causes the error, as it is not the way to do such a comparison.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what you do want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if Highest_Evidence eq 'Confirmatory' or Highest_Evidence eq 'Presumptive';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you could use:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if highest_evidence in ('Confirmatory','Presumptive');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please, from now on, please present the LOG by copying the log as text (not as a screen capture), and then pasting it into the window that appears when you click on the &amp;lt;/&amp;gt; icon.&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;FROM NOW ON, DO NOT SKIP THIS STEP.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Insert Log Icon in SAS Communities.png" style="width: 859px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66171iFEC370B1DBF07B28/image-size/large?v=v2&amp;amp;px=999" role="button" title="Insert Log Icon in SAS Communities.png" alt="Insert Log Icon in SAS Communities.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 15:47:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/If-and-Where-statements/m-p/796300#M32977</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-15T15:47:48Z</dc:date>
    </item>
  </channel>
</rss>

