<?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 How to check numerica data  between ranges in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-numerica-data-between-ranges/m-p/72344#M15600</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I want to check my data if it exists between ranges. Say for example my data is coming as decimals ranging 0.00 to 220.90 then if want to check data if first 3 bytes before decimals in range 140 - 150 and then last two bytes after decimals b/w 80 -89 , how to do this in data step statement.&lt;BR /&gt;
&lt;BR /&gt;
compress decimals and then use if then else??&lt;BR /&gt;
&lt;BR /&gt;
Please let me know soon.&lt;BR /&gt;
&lt;BR /&gt;
thanks,&lt;BR /&gt;
sasbase</description>
    <pubDate>Wed, 04 Feb 2009 00:35:19 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-02-04T00:35:19Z</dc:date>
    <item>
      <title>How to check numerica data  between ranges</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-numerica-data-between-ranges/m-p/72344#M15600</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I want to check my data if it exists between ranges. Say for example my data is coming as decimals ranging 0.00 to 220.90 then if want to check data if first 3 bytes before decimals in range 140 - 150 and then last two bytes after decimals b/w 80 -89 , how to do this in data step statement.&lt;BR /&gt;
&lt;BR /&gt;
compress decimals and then use if then else??&lt;BR /&gt;
&lt;BR /&gt;
Please let me know soon.&lt;BR /&gt;
&lt;BR /&gt;
thanks,&lt;BR /&gt;
sasbase</description>
      <pubDate>Wed, 04 Feb 2009 00:35:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-numerica-data-between-ranges/m-p/72344#M15600</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-02-04T00:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to check numerica data  between ranges</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-numerica-data-between-ranges/m-p/72345#M15601</link>
      <description>Depends on your SAS variable, whether it is character or numeric type.  If character type, recommend converting it to a numeric variable (different name) using the INPUT function, and then do your comparison, doing so in a SAS DATA step.  I have provided a link below to a SAS SUG/SGF user community paper which discusses INPUT function and data variable conversion.  There are others like this, available by searching at the SAS support website  &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  .&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi26/p056-26.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi26/p056-26.pdf&lt;/A&gt;</description>
      <pubDate>Wed, 04 Feb 2009 00:53:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-numerica-data-between-ranges/m-p/72345#M15601</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-02-04T00:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to check numerica data  between ranges</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-numerica-data-between-ranges/m-p/72346#M15602</link>
      <description>Have you considered using formats, something along these lines:&lt;BR /&gt;
&lt;BR /&gt;
data have;&lt;BR /&gt;
input val;&lt;BR /&gt;
cards;&lt;BR /&gt;
1&lt;BR /&gt;
20.5&lt;BR /&gt;
30.9&lt;BR /&gt;
140.0&lt;BR /&gt;
145.2&lt;BR /&gt;
145.85&lt;BR /&gt;
200&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc format;&lt;BR /&gt;
   value intPart&lt;BR /&gt;
   low - 139.99 = 'Low '&lt;BR /&gt;
   140 - 149.99 = 'Want'&lt;BR /&gt;
   150 - high   = 'High'&lt;BR /&gt;
   ;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc format;&lt;BR /&gt;
   value decPart&lt;BR /&gt;
   low - 0.79 = 'Low '&lt;BR /&gt;
   0.8 - 0.89 = 'Want'&lt;BR /&gt;
   0.9 - high   = 'High'&lt;BR /&gt;
   ;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data want;&lt;BR /&gt;
   set have;&lt;BR /&gt;
   intRange = put(val, intPart.);&lt;BR /&gt;
   decRange = put(val - int(val), decPart.);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
   create table summary&lt;BR /&gt;
   as&lt;BR /&gt;
   select intRange, decRange, count(val) as count&lt;BR /&gt;
   from want&lt;BR /&gt;
   group by 1,2&lt;BR /&gt;
   ;&lt;BR /&gt;
quit;</description>
      <pubDate>Wed, 04 Feb 2009 11:40:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-numerica-data-between-ranges/m-p/72346#M15602</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-02-04T11:40:38Z</dc:date>
    </item>
  </channel>
</rss>

