<?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: How to remove periods from a string with digits in decimal place in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-periods-from-a-string-with-digits-in-decimal-place/m-p/404895#M98433</link>
    <description>&lt;P&gt;I agree with the other posters, your test data is wrong.&amp;nbsp; One solution:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  if char(thestring,lengthn(thestring)-1)="." then thestring=substr(thestring,1,lengthn(thestring)-1);
run;
&lt;/PRE&gt;
&lt;P&gt;As you haven't provided test data in the form of a datastep I have made up a variable thestring.&lt;/P&gt;</description>
    <pubDate>Tue, 17 Oct 2017 17:00:27 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-10-17T17:00:27Z</dc:date>
    <item>
      <title>How to remove periods from a string with digits in decimal place</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-periods-from-a-string-with-digits-in-decimal-place/m-p/404890#M98430</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to pull a string out from a free text. I was able to use the substring and find function to pull out the specific area around the string. but there are periods marking the end of a sentence that I would like to remove. Not all rows have a period at the end (my assumption would be I could use compress, but then any decimals would be removed as well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;11.5&lt;/P&gt;
&lt;P&gt;12&lt;/P&gt;
&lt;P&gt;10.&lt;/P&gt;
&lt;P&gt;10.2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I would like:&lt;/P&gt;
&lt;P&gt;11.5&lt;/P&gt;
&lt;P&gt;12&lt;/P&gt;
&lt;P&gt;10&lt;/P&gt;
&lt;P&gt;10.2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I&amp;nbsp;was thinking maybe I could use the find function to find the second period and then delete? Any suggestions would be much appreciated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: My apologies, I forgot to remove the string&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 17:00:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-periods-from-a-string-with-digits-in-decimal-place/m-p/404890#M98430</guid>
      <dc:creator>daszlosek</dc:creator>
      <dc:date>2017-10-17T17:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove periods from a string with digits in decimal place</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-periods-from-a-string-with-digits-in-decimal-place/m-p/404892#M98431</link>
      <description>&lt;P&gt;There's no difference in your Have/Want&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 16:57:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-periods-from-a-string-with-digits-in-decimal-place/m-p/404892#M98431</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-17T16:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove periods from a string with digits in decimal place</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-periods-from-a-string-with-digits-in-decimal-place/m-p/404893#M98432</link>
      <description>&lt;P&gt;your example and what you want are same. so you want dot removed at the end of string?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 16:57:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-periods-from-a-string-with-digits-in-decimal-place/m-p/404893#M98432</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2017-10-17T16:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove periods from a string with digits in decimal place</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-periods-from-a-string-with-digits-in-decimal-place/m-p/404895#M98433</link>
      <description>&lt;P&gt;I agree with the other posters, your test data is wrong.&amp;nbsp; One solution:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  if char(thestring,lengthn(thestring)-1)="." then thestring=substr(thestring,1,lengthn(thestring)-1);
run;
&lt;/PRE&gt;
&lt;P&gt;As you haven't provided test data in the form of a datastep I have made up a variable thestring.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 17:00:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-periods-from-a-string-with-digits-in-decimal-place/m-p/404895#M98433</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-10-17T17:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove periods from a string with digits in decimal place</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-periods-from-a-string-with-digits-in-decimal-place/m-p/404902#M98436</link>
      <description>&lt;P&gt;Another way&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc;
input a $;
b=prxchange('s/^(.+?)(\.)*$/$1/', -1,trim(a));
datalines;
10.2
10.2.
10
10.3...
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Oct 2017 17:20:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-periods-from-a-string-with-digits-in-decimal-place/m-p/404902#M98436</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2017-10-17T17:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove periods from a string with digits in decimal place</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-periods-from-a-string-with-digits-in-decimal-place/m-p/405209#M98549</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc;
input a $;
b=prxchange('s/\.+$//', -1,trim(a));
datalines;
10.2
10.2.
10
10.3...
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Oct 2017 13:54:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-periods-from-a-string-with-digits-in-decimal-place/m-p/405209#M98549</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-10-18T13:54:06Z</dc:date>
    </item>
  </channel>
</rss>

