<?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: Reg:Characters from Last in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Characters-from-Last/m-p/71630#M20678</link>
    <description>If you are refering to characters, not words simply do:&lt;BR /&gt;
data _null_;&lt;BR /&gt;
x = 'Environmental Studies' ;&lt;BR /&gt;
y = substr(x, length(x) -4, 3);&lt;BR /&gt;
put y;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
You stated 10 - 15, but your example showed 3 of the last 5.</description>
    <pubDate>Thu, 29 Jan 2009 14:21:50 GMT</pubDate>
    <dc:creator>Flip</dc:creator>
    <dc:date>2009-01-29T14:21:50Z</dc:date>
    <item>
      <title>Reg:Characters from Last</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Characters-from-Last/m-p/71628#M20676</link>
      <description>Hi&lt;BR /&gt;
i am having 200 words i want the last 10 to 15 words to be printed&lt;BR /&gt;
here is the example&lt;BR /&gt;
&lt;BR /&gt;
'Environmental Studies'&lt;BR /&gt;
&lt;BR /&gt;
in this word i want the 'udi' word .How can i do this  as i said this is small example i am having 250-300 words and i cant cont by using substr how can i do this</description>
      <pubDate>Thu, 29 Jan 2009 10:18:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Characters-from-Last/m-p/71628#M20676</guid>
      <dc:creator>R_Win</dc:creator>
      <dc:date>2009-01-29T10:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:Characters from Last</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Characters-from-Last/m-p/71629#M20677</link>
      <description>I'm not sure I understand what you try to accomplish here.If you know what words (or extracts) to search for you can start looking at the FIND function. &lt;BR /&gt;
Maybe you can give us some more examples and expected result.&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Thu, 29 Jan 2009 11:52:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Characters-from-Last/m-p/71629#M20677</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-01-29T11:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:Characters from Last</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Characters-from-Last/m-p/71630#M20678</link>
      <description>If you are refering to characters, not words simply do:&lt;BR /&gt;
data _null_;&lt;BR /&gt;
x = 'Environmental Studies' ;&lt;BR /&gt;
y = substr(x, length(x) -4, 3);&lt;BR /&gt;
put y;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
You stated 10 - 15, but your example showed 3 of the last 5.</description>
      <pubDate>Thu, 29 Jan 2009 14:21:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Characters-from-Last/m-p/71630#M20678</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-01-29T14:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:Characters from Last</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Characters-from-Last/m-p/71631#M20679</link>
      <description>Thqs for the Reply</description>
      <pubDate>Fri, 30 Jan 2009 11:54:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Characters-from-Last/m-p/71631#M20679</guid>
      <dc:creator>R_Win</dc:creator>
      <dc:date>2009-01-30T11:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:Characters from Last</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Characters-from-Last/m-p/71632#M20680</link>
      <description>this code takes a character string of words and just gets the last 3 words.  I purposely made the length of the words different.  Don't know if this is the kind of thing you wanted to do.&lt;BR /&gt;
*****************************************&lt;BR /&gt;
&lt;BR /&gt;
data temp;&lt;BR /&gt;
wordstring = 'abc defg hijkl m nop qrstuvw xyz';&lt;BR /&gt;
end1 = length(wordstring);&lt;BR /&gt;
array start{*} start1-start3;&lt;BR /&gt;
array end{*} end1-end3;&lt;BR /&gt;
array lngth{*} lngth1-lngth3;&lt;BR /&gt;
start1 = anyspace(wordstring,-end1) + 1;&lt;BR /&gt;
lngth1 = end1 - start1 + 1;&lt;BR /&gt;
word1 = substr(wordstring,start1,lngth1);&lt;BR /&gt;
do i = 2 to 3;&lt;BR /&gt;
	start{i} = anyspace(wordstring,-(start{i-1}-2)) + 1;&lt;BR /&gt;
	lngth{i} = start{i-1} - start{i} -1;&lt;BR /&gt;
	end;&lt;BR /&gt;
word2 = substr(wordstring,start2,lngth2);&lt;BR /&gt;
word3 = substr(wordstring,start3,lngth3);&lt;BR /&gt;
run;&lt;BR /&gt;
proc print data = temp;&lt;BR /&gt;
var wordstring word1-word3; run;</description>
      <pubDate>Fri, 30 Jan 2009 21:17:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Characters-from-Last/m-p/71632#M20680</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-30T21:17:31Z</dc:date>
    </item>
  </channel>
</rss>

