substring from right

Reply
Frequent Contributor
Posts: 102

substring from right

is it possible to substring from the right?

i have an item. envscore.

i want to just extract score, how may i do so?

thank you!

Super Contributor
Posts: 490

Re: substring from right

Check this old thread

substring from right

And if this does not help give example of what your data and the desired output.

Esteemed Advisor
Posts: 7,295

Re: substring from right

Are you looking for something like the following?:

data want;

  set sashelp.class;

  last3chars_of_name=reverse(substr(reverse(trim(name)),1,3));

run;

Ask a Question
Discussion stats
  • 2 replies
  • 249 views
  • 0 likes
  • 3 in conversation