<?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: substring from the right in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165405#M42869</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Better indeed!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Apr 2014 02:27:01 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2014-04-11T02:27:01Z</dc:date>
    <item>
      <title>substring from the right</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165399#M42863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp; is there a quick way to substring from the right but skip a few digits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I have 2345001&amp;nbsp; I want to get 2345 .. I want to only remove the last 3 digits...&amp;nbsp; the length of the field is not uniform, soucl be 8 digits or 10 or 9, etc.&amp;nbsp; but th eonly thing sore sure is that I want to remove the last 3 digits..&amp;nbsp; Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 18:45:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165399#M42863</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2014-04-02T18:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: substring from the right</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165400#M42864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;myStr =&amp;nbsp; substr(myStr, 1, length(myStr) - 3);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 18:51:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165400#M42864</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-04-02T18:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: substring from the right</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165401#M42865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another approach in these sorts of situations is to use the substring function with the reverse function&lt;/P&gt;&lt;P&gt;mystr =&amp;nbsp; reverse(substr(strip(reverse(mystr)),4));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Apr 2014 21:31:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165401#M42865</guid>
      <dc:creator>monei011</dc:creator>
      <dc:date>2014-04-10T21:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: substring from the right</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165402#M42866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is your variable a number or a character string?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;137&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;138&amp;nbsp;&amp;nbsp;&amp;nbsp; x=2345001 ;&lt;/P&gt;&lt;P&gt;139&amp;nbsp;&amp;nbsp;&amp;nbsp; y=int(x/1000);&lt;/P&gt;&lt;P&gt;140&amp;nbsp;&amp;nbsp;&amp;nbsp; put x= y=;&lt;/P&gt;&lt;P&gt;141&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x=2345001 y=2345&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Apr 2014 23:30:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165402#M42866</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-04-10T23:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: substring from the right</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165403#M42867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The more, the merrier: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; mystr="2345001";&lt;/P&gt;&lt;P&gt;&amp;nbsp; new_str=prxchange('s/(^\w+)(\w{3}$)/$1/',-1,strip(mystr));&lt;/P&gt;&lt;P&gt;&amp;nbsp; put mystr= new_str=;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Apr 2014 23:32:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165403#M42867</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-04-10T23:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: substring from the right</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165404#M42868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The simpler, the better :smileysilly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data _null_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; mystr="&amp;nbsp; 2345001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; new_str = prxchange('s/\d{3}\s*$//', 1, mystr);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; put mystr= new_str=;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 02:22:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165404#M42868</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-04-11T02:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: substring from the right</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165405#M42869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Better indeed!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 02:27:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165405#M42869</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-04-11T02:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: substring from the right</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165406#M42870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Might be better use of prxchange, but not exactly readable nor intuitively obvious what the code is doing.&lt;/P&gt;&lt;P&gt;I'd want a comment explaining what was being done and why so that my BAU support junior could understand what the code was doing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 02:36:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165406#M42870</guid>
      <dc:creator>monei011</dc:creator>
      <dc:date>2014-04-11T02:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: substring from the right</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165407#M42871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It reads: Replace (s) a succession of exactly 3 ({3}) digits (\d) followed by any amount (*) of white space (\s) and occuring at the end of the string ($) with nothing(//). Do this only once.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 03:05:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/substring-from-the-right/m-p/165407#M42871</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-04-11T03:05:29Z</dc:date>
    </item>
  </channel>
</rss>

