<?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: If/Then statement problems in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/If-Then-statement-problems/m-p/430517#M68617</link>
    <description>&lt;P&gt;When you examine the variable AGEGRP, you will find that it is a numeric variable.&amp;nbsp; There is no way it could possibly hold the characters "30-35 months".&amp;nbsp; You may need to fix the data first.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jan 2018 16:05:42 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-01-24T16:05:42Z</dc:date>
    <item>
      <title>If/Then statement problems</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/If-Then-statement-problems/m-p/430514#M68616</link>
      <description>&lt;P&gt;Issue with If then subsetting statement with data with both numerical and character values. No error is showing but note is&amp;nbsp;&lt;SPAN&gt; NOTE: Invalid numeric data, '30-35 months' , at line 75 column 13. The output table is showing no values at all.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data nis_age;&lt;BR /&gt;set nis_use;&lt;BR /&gt;if AGEGRP = "30-35 months" then output;&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Help please.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 16:03:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/If-Then-statement-problems/m-p/430514#M68616</guid>
      <dc:creator>hudasaeb</dc:creator>
      <dc:date>2018-01-24T16:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: If/Then statement problems</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/If-Then-statement-problems/m-p/430517#M68617</link>
      <description>&lt;P&gt;When you examine the variable AGEGRP, you will find that it is a numeric variable.&amp;nbsp; There is no way it could possibly hold the characters "30-35 months".&amp;nbsp; You may need to fix the data first.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 16:05:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/If-Then-statement-problems/m-p/430517#M68617</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-01-24T16:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: If/Then statement problems</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/If-Then-statement-problems/m-p/430518#M68618</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/183371"&gt;@hudasaeb&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Issue with If then subsetting statement with data with both numerical and character values. No error is showing but note is&amp;nbsp;&lt;SPAN&gt; NOTE: Invalid numeric data, '30-35 months' , at line 75 column 13. The output table is showing no values at all.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data nis_age;&lt;BR /&gt;set nis_use;&lt;BR /&gt;if AGEGRP = "30-35 months" then output;&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Help please.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;says, AGEGRP is numeric. If the values of Agegrp are integers you could use in with the range operator:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if AGEGRP in (30:35) then output;&lt;/P&gt;
&lt;P&gt;or alternatively&lt;/P&gt;
&lt;P&gt;if 30 le agegrp le 35 then output;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;le is "less than or equal" to include the end values.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 16:12:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/If-Then-statement-problems/m-p/430518#M68618</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-01-24T16:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: If/Then statement problems</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/If-Then-statement-problems/m-p/430521#M68619</link>
      <description>&lt;P&gt;My guess is that your dataset has formatted values. If that is the case, then you could use the vvalue function. i.e.,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data nis_age;
  set nis_use;
  if vvalue(AGE_GROUP) eq '30-35 months';
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 16:21:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/If-Then-statement-problems/m-p/430521#M68619</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-01-24T16:21:08Z</dc:date>
    </item>
  </channel>
</rss>

