<?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: Check and Verify for numeric data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Check-and-Verify-for-numeric-data/m-p/447854#M112579</link>
    <description>&lt;P&gt;No, because it's a character function, not numeric.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are relatively easy other ways, but I suspect you're also going to extend this beyond this specific example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*check for integers 1 to 10;
if age in (1:10) then...;

*check for values 1 to 10, including endpoints;
if  1&amp;lt;=age&amp;lt;=10 then...;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 22 Mar 2018 19:40:45 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-03-22T19:40:45Z</dc:date>
    <item>
      <title>Check and Verify for numeric data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-and-Verify-for-numeric-data/m-p/447852#M112578</link>
      <description>&lt;P&gt;I was wondering if there is a way to use the verify function with my check as a numeric interval. For example,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;check= '1-10';&lt;/P&gt;&lt;P&gt;if verify(Age, check) ne 0 then put 'not allowed';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 17:00:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-and-Verify-for-numeric-data/m-p/447852#M112578</guid>
      <dc:creator>emkotnik</dc:creator>
      <dc:date>2018-03-22T17:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Check and Verify for numeric data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-and-Verify-for-numeric-data/m-p/447854#M112579</link>
      <description>&lt;P&gt;No, because it's a character function, not numeric.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are relatively easy other ways, but I suspect you're also going to extend this beyond this specific example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*check for integers 1 to 10;
if age in (1:10) then...;

*check for values 1 to 10, including endpoints;
if  1&amp;lt;=age&amp;lt;=10 then...;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Mar 2018 19:40:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-and-Verify-for-numeric-data/m-p/447854#M112579</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-22T19:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Check and Verify for numeric data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-and-Verify-for-numeric-data/m-p/447905#M112600</link>
      <description>&lt;P&gt;For some uses a format might work to create output similar to what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Proc format library=work;
value validage
1 - 10 ='Valid'
other  = 'Invalid';
run;

data example;
   input Age;
   put Age= age validage.;
datalines;
1
3
.
15
;
run;&lt;/PRE&gt;
&lt;P&gt;This approach is fairly flexible if you have similar variables that all use the same range for valid values. It will also work for character values with the proper format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending on what is done with the information, such as a step later to recode to value, then perhaps an informat might be appropriate to read and recode at one step.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 19:37:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-and-Verify-for-numeric-data/m-p/447905#M112600</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-22T19:37:28Z</dc:date>
    </item>
  </channel>
</rss>

