<?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: extracting the part of  string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/extracting-the-part-of-string/m-p/248106#M46574</link>
    <description>&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;last4 = substrn(ssn,lengthn(ssn)-4+1);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 04 Feb 2016 21:44:48 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2016-02-04T21:44:48Z</dc:date>
    <item>
      <title>extracting the part of  string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/extracting-the-part-of-string/m-p/248105#M46573</link>
      <description>&lt;P&gt;How to get the last 4 digits of SSN from this data?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data SSN;
  input SSN $;
  cards;
  123456789
  12345678
  1234567
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Feb 2016 21:37:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/extracting-the-part-of-string/m-p/248105#M46573</guid>
      <dc:creator>SAS_inquisitive</dc:creator>
      <dc:date>2016-02-04T21:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: extracting the part of  string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/extracting-the-part-of-string/m-p/248106#M46574</link>
      <description>&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;last4 = substrn(ssn,lengthn(ssn)-4+1);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Feb 2016 21:44:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/extracting-the-part-of-string/m-p/248106#M46574</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-02-04T21:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: extracting the part of  string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/extracting-the-part-of-string/m-p/248107#M46575</link>
      <description>&lt;P&gt;With your data step you lose already the "9" in the first row.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data SSN;
input SSN :$9.; /* The default length 8 is insufficient! */
cards;
123456789
12345678
1234567
;
run;

data want;
set ssn;
length last4d $4;
last4d=substr(ssn,length(ssn)-3);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Feb 2016 21:45:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/extracting-the-part-of-string/m-p/248107#M46575</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-02-04T21:45:21Z</dc:date>
    </item>
  </channel>
</rss>

