<?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: substr from one position after last alphabetic in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/substr-from-one-position-after-last-alphabetic/m-p/876995#M346451</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input X $30.;
cards;
A22318PKRZD300125565
A21312QFYJR300057503
A22093FZCCP300088437
ABCDEFG3000999
;
Run;

data want;
   set have;
   x_new = scan(x, -1, , 'a');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Result:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;X                     x_new
A22318PKRZD300125565  300125565
A21312QFYJR300057503  300057503
A22093FZCCP300088437  300088437
ABCDEFG3000999        3000999&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 May 2023 06:35:07 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2023-05-23T06:35:07Z</dc:date>
    <item>
      <title>substr from one position after last alphabetic</title>
      <link>https://communities.sas.com/t5/SAS-Programming/substr-from-one-position-after-last-alphabetic/m-p/876993#M346449</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to create a new variable called X_new.&lt;/P&gt;
&lt;P&gt;The value in X_new will be as following:&lt;/P&gt;
&lt;P&gt;Need to find the location of last alphabetic in variable X&amp;nbsp; and then substr from one position after until the end.&lt;/P&gt;
&lt;P&gt;Resulted values will be:&lt;/P&gt;
&lt;P&gt;300125565&lt;BR /&gt;300057503&lt;BR /&gt;300088437&lt;BR /&gt;3000999&lt;/P&gt;
&lt;P&gt;What is the way to calculate the new variable x_new?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input X $30.;
cards;
A22318PKRZD300125565
A21312QFYJR300057503
A22093FZCCP300088437
ABCDEFG3000999
;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 May 2023 06:20:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/substr-from-one-position-after-last-alphabetic/m-p/876993#M346449</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2023-05-23T06:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: substr from one position after last alphabetic</title>
      <link>https://communities.sas.com/t5/SAS-Programming/substr-from-one-position-after-last-alphabetic/m-p/876995#M346451</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input X $30.;
cards;
A22318PKRZD300125565
A21312QFYJR300057503
A22093FZCCP300088437
ABCDEFG3000999
;
Run;

data want;
   set have;
   x_new = scan(x, -1, , 'a');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Result:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;X                     x_new
A22318PKRZD300125565  300125565
A21312QFYJR300057503  300057503
A22093FZCCP300088437  300088437
ABCDEFG3000999        3000999&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 06:35:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/substr-from-one-position-after-last-alphabetic/m-p/876995#M346451</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2023-05-23T06:35:07Z</dc:date>
    </item>
  </channel>
</rss>

