<?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: scan funtion: scan number 9 and 10 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/scan-funtion-scan-number-9-and-10/m-p/291035#M60289</link>
    <description>&lt;P&gt;Thank you very much,&lt;/P&gt;
&lt;P&gt;the values are only&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;letters, with number 9 or 10, or 2, so I need to use scan to find whether it is 9 or 10, if it is 9, then it will labeled as "9", it will labeled as "10" if it includes "10"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the value is just like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"from iab2.iab10_ab_fi12"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;" from iab2.iab9_ab_fi15"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I only care the middle whether it is "9" or "10, but the last numbers are not "9" or "10", it is either "12" or "15"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Aug 2016 18:10:36 GMT</pubDate>
    <dc:creator>Bal23</dc:creator>
    <dc:date>2016-08-11T18:10:36Z</dc:date>
    <item>
      <title>scan funtion: scan number 9 and 10</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scan-funtion-scan-number-9-and-10/m-p/291014#M60282</link>
      <description>&lt;P&gt;I need to create a new variable, with scan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if scan&amp;nbsp; var1, var2, var3 , those variables are alpha numeric characters, if there is number 9, then newvar=9;&lt;/P&gt;
&lt;P&gt;if there is a number 10, then newvar=10&lt;/P&gt;
&lt;P&gt;it seems to me difficult, since 10 is a two digit and 9 is one digit&lt;/P&gt;
&lt;P&gt;would you please give advice&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the var looks like&lt;/P&gt;
&lt;P&gt;abc abcde9&lt;/P&gt;
&lt;P&gt;abc abc.cbc9_dd_ee12&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 15:45:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scan-funtion-scan-number-9-and-10/m-p/291014#M60282</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-08-11T15:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: scan funtion: scan number 9 and 10</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scan-funtion-scan-number-9-and-10/m-p/291022#M60284</link>
      <description />
      <pubDate>Thu, 11 Aug 2016 17:07:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scan-funtion-scan-number-9-and-10/m-p/291022#M60284</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2016-08-11T17:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: scan funtion: scan number 9 and 10</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scan-funtion-scan-number-9-and-10/m-p/291023#M60285</link>
      <description>&lt;P&gt;Does this help you?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
array k[*] $ newvar1 -newvar3;

infile datalines missover;
input v1 $ v2$ v3$;
array var[*]$ v1 - v3;
do _N_ = 1 to dim(var);
   k[_N_] = compress(var[_N_], , 'kd');
end;
datalines;
abc abcde9          
abc abc.cbc9 _dd_ee12
;
run;

proc print data = have;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Aug 2016 17:09:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scan-funtion-scan-number-9-and-10/m-p/291023#M60285</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2016-08-11T17:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: scan funtion: scan number 9 and 10</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scan-funtion-scan-number-9-and-10/m-p/291031#M60288</link>
      <description>&lt;P&gt;You have omitted too much.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why are we scanning for alphnumeric characters?&amp;nbsp; If we find ????9#$@% should that not be a "9"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Evidently, a decimal point is permitted as an alphanumeric character.&amp;nbsp; What else would be permitted?&amp;nbsp; Underscores?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does finding a "9" include either of these:&amp;nbsp; abc29 or xyz92&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What should happen if we find both a "9" and a "10" such as "ab9 abcd10"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would cut down on a lot of the work if you would provide more of the details.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 17:59:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scan-funtion-scan-number-9-and-10/m-p/291031#M60288</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-08-11T17:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: scan funtion: scan number 9 and 10</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scan-funtion-scan-number-9-and-10/m-p/291035#M60289</link>
      <description>&lt;P&gt;Thank you very much,&lt;/P&gt;
&lt;P&gt;the values are only&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;letters, with number 9 or 10, or 2, so I need to use scan to find whether it is 9 or 10, if it is 9, then it will labeled as "9", it will labeled as "10" if it includes "10"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the value is just like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"from iab2.iab10_ab_fi12"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;" from iab2.iab9_ab_fi15"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I only care the middle whether it is "9" or "10, but the last numbers are not "9" or "10", it is either "12" or "15"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 18:10:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scan-funtion-scan-number-9-and-10/m-p/291035#M60289</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-08-11T18:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: scan funtion: scan number 9 and 10</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scan-funtion-scan-number-9-and-10/m-p/291037#M60290</link>
      <description>&lt;P&gt;OK, here's something you can try to see if it meets your requirements:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if index(var, '10') then value='10';&lt;/P&gt;
&lt;P&gt;else if index(var, '9') then value='9';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It sounds like it should be correct, but you will have to test against a variety of cases to see if you get the results you want.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 18:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scan-funtion-scan-number-9-and-10/m-p/291037#M60290</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-08-11T18:17:41Z</dc:date>
    </item>
  </channel>
</rss>

