<?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 function last caracters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Substr-function-last-caracters/m-p/710794#M218874</link>
    <description>&lt;P&gt;Doesn't work is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the &amp;lt;&amp;gt; to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consider this example:&lt;/P&gt;
&lt;PRE&gt;data example;
   x='LM7613369000000091800505984';
   y=substr(x,length(x)-10);
run;&lt;/PRE&gt;
&lt;P&gt;And think about why -10 yields 11 characters.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jan 2021 12:24:14 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-01-12T12:24:14Z</dc:date>
    <item>
      <title>Substr function last caracters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Substr-function-last-caracters/m-p/710791#M218871</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have the data like this : LM7613369000000091800505984.&lt;/P&gt;
&lt;P&gt;I would like to have the 11 &lt;STRONG&gt;&lt;U&gt;last caracters&lt;/U&gt;&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;My code is&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NO1=substr(Num,11,-1)&lt;/P&gt;
&lt;P&gt;But it doesn't work.&lt;/P&gt;
&lt;P&gt;Could you help me please ?&lt;/P&gt;
&lt;P&gt;Thank you !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 12:18:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Substr-function-last-caracters/m-p/710791#M218871</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2021-01-12T12:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Substr function last caracters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Substr-function-last-caracters/m-p/710792#M218872</link>
      <description>&lt;P&gt;Do this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   str = "LM7613369000000091800505984";
   last11 = substr(str, length(str)-10);
   put last11 =;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;last11=91800505984
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 12:21:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Substr-function-last-caracters/m-p/710792#M218872</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-01-12T12:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Substr function last caracters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Substr-function-last-caracters/m-p/710794#M218874</link>
      <description>&lt;P&gt;Doesn't work is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the &amp;lt;&amp;gt; to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consider this example:&lt;/P&gt;
&lt;PRE&gt;data example;
   x='LM7613369000000091800505984';
   y=substr(x,length(x)-10);
run;&lt;/PRE&gt;
&lt;P&gt;And think about why -10 yields 11 characters.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 12:24:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Substr-function-last-caracters/m-p/710794#M218874</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-12T12:24:14Z</dc:date>
    </item>
  </channel>
</rss>

