<?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 Flag column having special character except dot, apostrophe, hyphen and comma in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Flag-column-having-special-character-except-dot-apostrophe/m-p/504335#M134945</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I need your kind help to detect one column having any special characters with or without dot, apostrophe, hyphen and comma. If it contains only&amp;nbsp;&lt;SPAN&gt;dot, apostrophe, hyphen or comma, I don't want to flag.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input  name $;
datalines;
abc
def_
def-ghi
def's
def.
def@ghi.ijk
def-ghi&amp;amp;ijk
def%
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;I want to flag the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;def_&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;def@ghi.ijk&lt;BR /&gt;def-ghi&amp;amp;ijk&lt;BR /&gt;def%&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you in advance for your kind reply.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Oct 2018 14:31:48 GMT</pubDate>
    <dc:creator>DeepakSwain</dc:creator>
    <dc:date>2018-10-15T14:31:48Z</dc:date>
    <item>
      <title>Flag column having special character except dot, apostrophe, hyphen and comma</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Flag-column-having-special-character-except-dot-apostrophe/m-p/504335#M134945</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I need your kind help to detect one column having any special characters with or without dot, apostrophe, hyphen and comma. If it contains only&amp;nbsp;&lt;SPAN&gt;dot, apostrophe, hyphen or comma, I don't want to flag.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input  name $;
datalines;
abc
def_
def-ghi
def's
def.
def@ghi.ijk
def-ghi&amp;amp;ijk
def%
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;I want to flag the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;def_&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;def@ghi.ijk&lt;BR /&gt;def-ghi&amp;amp;ijk&lt;BR /&gt;def%&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you in advance for your kind reply.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 14:31:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Flag-column-having-special-character-except-dot-apostrophe/m-p/504335#M134945</guid>
      <dc:creator>DeepakSwain</dc:creator>
      <dc:date>2018-10-15T14:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Flag column having special character except dot, apostrophe, hyphen and comma</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Flag-column-having-special-character-except-dot-apostrophe/m-p/504348#M134952</link>
      <description>&lt;P&gt;You may want to provide an explicit definition of "special characters". I don't believe that there is an actual standard definition. I know I have issues with various password rules and they have different lists of special characters that are acceptable or refused.&lt;/P&gt;
&lt;P&gt;This might get you started. It should be easy to add or remove suspect characters though a " as done will be a bit trickier.&lt;/P&gt;
&lt;PRE&gt;data have;
input  name $;
flag = findc(name,"!@#$%^&amp;amp;*()_+=",'')&amp;gt;0;
datalines;
abc
def_
def-ghi
def's
def.
def@ghi.ijk
def-ghi&amp;amp;ijk
def%
;
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Oct 2018 14:52:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Flag-column-having-special-character-except-dot-apostrophe/m-p/504348#M134952</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-15T14:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: Flag column having special character except dot, apostrophe, hyphen and comma</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Flag-column-having-special-character-except-dot-apostrophe/m-p/504352#M134953</link>
      <description>&lt;P&gt;Hi Ballardw,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The suggested advice is great. Only limitation with this to provide a list of special characters of interest to flag.&lt;/P&gt;&lt;P&gt;I am trying to use ANYPUNCT function but unable to apply my exclusion list i.e. dot, aposytrophe, hypen and comma.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you kindly help me if feasible to use anypunct function so the code may be generalized.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once again thank you for your kind reply.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 15:03:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Flag-column-having-special-character-except-dot-apostrophe/m-p/504352#M134953</guid>
      <dc:creator>DeepakSwain</dc:creator>
      <dc:date>2018-10-15T15:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Flag column having special character except dot, apostrophe, hyphen and comma</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Flag-column-having-special-character-except-dot-apostrophe/m-p/504356#M134955</link>
      <description>&lt;P&gt;ANYPUNCT will not work as several of the characters you appear to want flagged such a &amp;amp; and @ (note&lt;STRONG&gt;: asked for definition of "special character"&lt;/STRONG&gt; ) are not punctuation characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 15:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Flag-column-having-special-character-except-dot-apostrophe/m-p/504356#M134955</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-15T15:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Flag column having special character except dot, apostrophe, hyphen and comma</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Flag-column-having-special-character-except-dot-apostrophe/m-p/504406#M134976</link>
      <description>&lt;P&gt;What is your definition of special?&amp;nbsp; All of the strings you posted have characters other than the ones you listed.&amp;nbsp; Did you mean to allow normal alphanumeric characters?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
   set have;
   flag=' '^=compress(name,".',-",'ad');
run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Obs    name           flag

 1     abc              0
 2     def_             1
 3     def-ghi          0
 4     def's            0
 5     def.             0
 6     def@ghi.ijk      1
 7     def-ghi&amp;amp;ijk      1
 8     def%             1&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Oct 2018 17:58:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Flag-column-having-special-character-except-dot-apostrophe/m-p/504406#M134976</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-10-15T17:58:59Z</dc:date>
    </item>
  </channel>
</rss>

