<?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 How to extract a string up till last numeric component? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-a-string-up-till-last-numeric-component/m-p/919991#M362351</link>
    <description>Let’s say I have an alphanumeric string of “abcdef123ghi”, how can I extract and get up till the last digit of the string “abcdef123”? I was trying to find the location of the last digit using find and reverse, and use substr to extract it but it doesn’t work. Thanks for your help in advance</description>
    <pubDate>Tue, 12 Mar 2024 19:02:53 GMT</pubDate>
    <dc:creator>Feyng819</dc:creator>
    <dc:date>2024-03-12T19:02:53Z</dc:date>
    <item>
      <title>How to extract a string up till last numeric component?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-a-string-up-till-last-numeric-component/m-p/919991#M362351</link>
      <description>Let’s say I have an alphanumeric string of “abcdef123ghi”, how can I extract and get up till the last digit of the string “abcdef123”? I was trying to find the location of the last digit using find and reverse, and use substr to extract it but it doesn’t work. Thanks for your help in advance</description>
      <pubDate>Tue, 12 Mar 2024 19:02:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-a-string-up-till-last-numeric-component/m-p/919991#M362351</guid>
      <dc:creator>Feyng819</dc:creator>
      <dc:date>2024-03-12T19:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a string up till last numeric component?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-a-string-up-till-last-numeric-component/m-p/919997#M362355</link>
      <description>&lt;P&gt;Try SUBSTR with &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_048/lefunctionsref/p0gq8bwobt4wjgn12km94wi66mxw.htm" target="_self"&gt;ANYDIGIT:&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
	string="abcdef123ghi";
	want=substr(string,1,anydigit(string,-9999));
	put string= want=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_048/lefunctionsref/p0gq8bwobt4wjgn12km94wi66mxw.htm" target="_self"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/v_048/lefunctionsref/p0gq8bwobt4wjgn12km94wi66mxw.htm&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 19:22:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-a-string-up-till-last-numeric-component/m-p/919997#M362355</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2024-03-12T19:22:29Z</dc:date>
    </item>
  </channel>
</rss>

