<?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: Remove special char. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748317#M235035</link>
    <description>&lt;PRE&gt;data have;
input string $20.;
want=prxchange('s/^\.+|\.+$//',-1,strip(string));
cards;
...Tes.t...
.....abd.de..
..wer..r...
..dum..test....
;;;;
run;&lt;/PRE&gt;</description>
    <pubDate>Wed, 16 Jun 2021 12:05:35 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2021-06-16T12:05:35Z</dc:date>
    <item>
      <title>Remove special char.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748137#M234923</link>
      <description>&lt;P&gt;How to remove a special character in beginning and last of specific variable&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example "...Tes.t..." and needs to be "Tes.t" as compress function removes all dots&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 14:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748137#M234923</guid>
      <dc:creator>AmrAd</dc:creator>
      <dc:date>2021-06-15T14:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Remove special char.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748139#M234924</link>
      <description>&lt;P&gt;How many variables do you need to this for? If it is just that one, you could use SUBSTR.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 14:47:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748139#M234924</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-06-15T14:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Remove special char.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748140#M234925</link>
      <description>a lot of variables</description>
      <pubDate>Tue, 15 Jun 2021 14:48:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748140#M234925</guid>
      <dc:creator>AmrAd</dc:creator>
      <dc:date>2021-06-15T14:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Remove special char.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748142#M234927</link>
      <description>ant not all variables having same length</description>
      <pubDate>Tue, 15 Jun 2021 14:48:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748142#M234927</guid>
      <dc:creator>AmrAd</dc:creator>
      <dc:date>2021-06-15T14:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: Remove special char.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748145#M234930</link>
      <description>You need to provide more details about specifically what the rules are and how they can be applied. Otherwise I can show you a solution that will work for exactly what you post but then won't work on your actual data.</description>
      <pubDate>Tue, 15 Jun 2021 14:52:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748145#M234930</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-06-15T14:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Remove special char.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748146#M234931</link>
      <description>let me clarify more&lt;BR /&gt;i have values like (....abd.de..,..wer..r..,etc) as system out put&lt;BR /&gt;i need to remove the dots only in the begining and end of each record and keep the dots as it is between the words to be like below&lt;BR /&gt;abd.de&lt;BR /&gt;wer..r&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Jun 2021 14:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748146#M234931</guid>
      <dc:creator>AmrAd</dc:creator>
      <dc:date>2021-06-15T14:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Remove special char.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748149#M234932</link>
      <description>i think i found a solution as below&lt;BR /&gt;&lt;BR /&gt;var1=tranwrd(variable,'.',' ');&lt;BR /&gt;final=tranwrd(srtip(var1),' ','.');&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;it works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 15 Jun 2021 15:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748149#M234932</guid>
      <dc:creator>AmrAd</dc:creator>
      <dc:date>2021-06-15T15:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Remove special char.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748155#M234935</link>
      <description>&lt;P&gt;That replaces your dots in the middle with spaces which wasn't what you said you wanted to do. &lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input string $20.;
cards;
.....abd.de..
..wer..r...
..dum..test....
;;;;
run;

data want;
set have;
start=anyalpha(string);
end=anyalpha(left(reverse(string)));
want = substr(string, start, length(string) - end - start + 2);
var1=tranwrd(string,'.',' ');
final=tranwrd(strip(string),' ','.');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Jun 2021 15:28:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748155#M234935</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-06-16T15:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Remove special char.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748179#M234947</link>
      <description>&lt;P&gt;You probably want to use TRANSLATE() so you can swap the periods and spaces and then swap them back.&amp;nbsp; If you want to remove the trailing periods from values that last have trailing spaces then use TRIM() on the value first.&lt;/P&gt;
&lt;P&gt;You can then apply that to a series of variables by using an ARRAY.&lt;/P&gt;
&lt;P&gt;For example you could try it on all of the character variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  set have;
  array _c _character_;
  do over _c;
    _c=translate(strip(translate(trim(_c),'. ',' .')),'. ',' .');
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Jun 2021 17:12:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748179#M234947</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-06-15T17:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Remove special char.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748317#M235035</link>
      <description>&lt;PRE&gt;data have;
input string $20.;
want=prxchange('s/^\.+|\.+$//',-1,strip(string));
cards;
...Tes.t...
.....abd.de..
..wer..r...
..dum..test....
;;;;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Jun 2021 12:05:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-special-char/m-p/748317#M235035</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-06-16T12:05:35Z</dc:date>
    </item>
  </channel>
</rss>

