<?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 Test for certain numeric values in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Test-for-certain-numeric-values/m-p/216517#M53312</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I have two Char fields with a length of 10, named "Acct" and "Derived".&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I need to test the "Acct" field, and if the value has a length of 6, and is a numeric value between 100,000 &amp;amp; 999,999, then copy the value to the "Derived" field.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;How to code the Update statement? &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Sample data looks like this:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Acct&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;==========&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;1&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;100&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;1000A&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;201000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ==&amp;gt; Copy&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;210000A&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;312456&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;==&amp;gt; Copy&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;A400010&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I'm a newbie just learning, so please be specific in your response.i&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 May 2015 13:19:07 GMT</pubDate>
    <dc:creator>sasbanker</dc:creator>
    <dc:date>2015-05-18T13:19:07Z</dc:date>
    <item>
      <title>Test for certain numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Test-for-certain-numeric-values/m-p/216517#M53312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I have two Char fields with a length of 10, named "Acct" and "Derived".&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I need to test the "Acct" field, and if the value has a length of 6, and is a numeric value between 100,000 &amp;amp; 999,999, then copy the value to the "Derived" field.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;How to code the Update statement? &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Sample data looks like this:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Acct&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;==========&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;1&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;100&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;1000A&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;201000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ==&amp;gt; Copy&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;210000A&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;312456&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;==&amp;gt; Copy&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;A400010&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I'm a newbie just learning, so please be specific in your response.i&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2015 13:19:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Test-for-certain-numeric-values/m-p/216517#M53312</guid>
      <dc:creator>sasbanker</dc:creator>
      <dc:date>2015-05-18T13:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Test for certain numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Test-for-certain-numeric-values/m-p/216518#M53313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try the below approch ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set have&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;if notdigit(acct) = 0 and lenght(acct)&amp;nbsp; = 6 and&amp;nbsp; 100000 =&amp;lt;acct &amp;gt;=999999 then&amp;nbsp; derived = acct ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2015 14:16:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Test-for-certain-numeric-values/m-p/216518#M53313</guid>
      <dc:creator>naveen20jan</dc:creator>
      <dc:date>2015-05-18T14:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Test for certain numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Test-for-certain-numeric-values/m-p/216519#M53314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input acct $;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;100&lt;/P&gt;&lt;P&gt;1000A&lt;/P&gt;&lt;P&gt;201000&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;210000A&lt;/P&gt;&lt;P&gt;312456&amp;nbsp; &lt;/P&gt;&lt;P&gt;A400010&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt; set have;&lt;/P&gt;&lt;P&gt; length derived $ 10;&lt;/P&gt;&lt;P&gt; if 100000&amp;lt;=input(acct,?? best32.)&amp;lt;=999999 then derived=acct;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2015 14:20:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Test-for-certain-numeric-values/m-p/216519#M53314</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-05-18T14:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Test for certain numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Test-for-certain-numeric-values/m-p/216520#M53315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to note, you don't actually need to check the length there:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;if notdigit(acct) = 0 and 100000 =&amp;lt;acct &amp;gt;=999999 then&amp;nbsp; derived = acct ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;As anything not between the given upper and lower includes those with a length ne 6.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2015 14:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Test-for-certain-numeric-values/m-p/216520#M53315</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-18T14:30:21Z</dc:date>
    </item>
  </channel>
</rss>

