<?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: Anyalpha function not working in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Anyalpha-function-not-working/m-p/463861#M118235</link>
    <description>&lt;P&gt;Ugh, yes, that is the reason.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 21 May 2018 19:16:12 GMT</pubDate>
    <dc:creator>Batman</dc:creator>
    <dc:date>2018-05-21T19:16:12Z</dc:date>
    <item>
      <title>Anyalpha function not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Anyalpha-function-not-working/m-p/463848#M118226</link>
      <description>&lt;P&gt;I apply the anyalpha function as a filter in row 35, however, it fails to stop all the cases where there is an alphabetic character.&amp;nbsp;&amp;nbsp; However, when I attempt to flag them after creating a new variable it does pick them up (see row 51).&amp;nbsp;&amp;nbsp; What gives?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;28 data POS17;&lt;/P&gt;&lt;P&gt;29 length CCN $6;&lt;/P&gt;&lt;P&gt;30 set SAS.POS_DEC17(keep=&amp;amp;POSVARS);&lt;/P&gt;&lt;P&gt;31 /*AP filters, see item A.1.a.*/&lt;/P&gt;&lt;P&gt;32 if PRVDR_CTGRY_CD = '01'&lt;/P&gt;&lt;P&gt;33 and PRVDR_CTGRY_SBTYP_CD = '01'&lt;/P&gt;&lt;P&gt;34 and length(PRVDR_NUM) = 6&lt;/P&gt;&lt;P&gt;35 and anyalpha(PRVDR_NUM) = 0&lt;/P&gt;&lt;P&gt;36 and ELGBLTY_SW EQ "Y"&lt;/P&gt;&lt;P&gt;37 and ORGNL_PRTCPTN_DT le "2017.0101"&lt;/P&gt;&lt;P&gt;38 and TRMNTN_EXPRTN_DT = '' or TRMNTN_EXPRTN_DT gt "2017.0101"&lt;/P&gt;&lt;P&gt;39 ;&lt;/P&gt;&lt;P&gt;40 if STATE_CD in ('AS', 'FN', 'GU', 'MP', 'MX', 'PR', 'VI', 'MD')&lt;/P&gt;&lt;P&gt;41 or PRVDR_NUM in ('050204' '100006' '310008' '330059'&lt;/P&gt;&lt;P&gt;42 '050238' '100073' '310012' '330119'&lt;/P&gt;&lt;P&gt;43 '050351' '100080' '310019' '330167'&lt;/P&gt;&lt;P&gt;44 '050481' '100131' '310054' '330198'&lt;/P&gt;&lt;P&gt;45 '050485' '100228' '310074' '330205'&lt;/P&gt;&lt;P&gt;46 '050603' '100253' '330024' '330214'&lt;/P&gt;&lt;P&gt;47 '050678' '100275' '330045' '360027'&lt;/P&gt;&lt;P&gt;48 '070022' '310005' '330046' '450056')&lt;/P&gt;&lt;P&gt;49 then delete;&lt;/P&gt;&lt;P&gt;50 ccn=trim(Prvdr_num);&lt;/P&gt;&lt;P&gt;51 if _n_ lt 10000 and anyalpha(CCN) gt 0 then put _n_= PRVDR_NUM=;&lt;/P&gt;&lt;P&gt;52 run;&lt;/P&gt;&lt;P&gt;_N_=4259 PRVDR_NUM=03C0001312&lt;/P&gt;&lt;P&gt;_N_=4370 PRVDR_NUM=03X0009825&lt;/P&gt;&lt;P&gt;_N_=6220 PRVDR_NUM=04A327&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 18:38:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Anyalpha-function-not-working/m-p/463848#M118226</guid>
      <dc:creator>Batman</dc:creator>
      <dc:date>2018-05-21T18:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Anyalpha function not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Anyalpha-function-not-working/m-p/463857#M118231</link>
      <description>&lt;P&gt;I suspect that you need to carefully examine the order of operations being performed and examining ALL of the variables used in that IF statement&amp;nbsp; when you get unexpected results. Without more complete data for an example I might start by looking at values of TRMNTN_EXPRTN_DT for those records.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code like TRMNTN_EXPRTN_DT gt "2017.0101" can be pretty problematic as comparison of string values with&amp;nbsp;greater or less often yields&amp;nbsp;unexpected results&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 19:10:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Anyalpha-function-not-working/m-p/463857#M118231</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-21T19:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Anyalpha function not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Anyalpha-function-not-working/m-p/463858#M118232</link>
      <description>&lt;P&gt;I think you've got an order of operations problem.&amp;nbsp; Note the last line of your subsetting IF:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;32 if PRVDR_CTGRY_CD = '01'
33 and PRVDR_CTGRY_SBTYP_CD = '01'
34 and length(PRVDR_NUM) = 6
35 and anyalpha(PRVDR_NUM) = 0
36 and ELGBLTY_SW EQ "Y"
37 and ORGNL_PRTCPTN_DT le "2017.0101"
38 and TRMNTN_EXPRTN_DT = '' or TRMNTN_EXPRTN_DT gt "2017.0101"
39 ;&lt;/PRE&gt;
&lt;P&gt;Because you have an OR at the end, any record with TRMNTN_EXPRTN_DT gt "2017.0101" will be kept, even if it has alpha characters in PRVDR_NUM.&amp;nbsp; I suspect you should add parentheses to that last line, i.e.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;32 if PRVDR_CTGRY_CD = '01'
33 and PRVDR_CTGRY_SBTYP_CD = '01'
34 and length(PRVDR_NUM) = 6
35 and anyalpha(PRVDR_NUM) = 0
36 and ELGBLTY_SW EQ "Y"
37 and ORGNL_PRTCPTN_DT le "2017.0101"
38 and (TRMNTN_EXPRTN_DT = '' or TRMNTN_EXPRTN_DT gt "2017.0101")
39 ;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 May 2018 19:13:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Anyalpha-function-not-working/m-p/463858#M118232</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2018-05-21T19:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Anyalpha function not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Anyalpha-function-not-working/m-p/463861#M118235</link>
      <description>&lt;P&gt;Ugh, yes, that is the reason.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 19:16:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Anyalpha-function-not-working/m-p/463861#M118235</guid>
      <dc:creator>Batman</dc:creator>
      <dc:date>2018-05-21T19:16:12Z</dc:date>
    </item>
  </channel>
</rss>

