Extracting last character from a text field in SAS

Experts,

Can someone tell me how to extract the last character from a text field.  Below is an example of a text fieldA and I would like to extract the last character which in this case is '5'.  Field A can be any length

 Field A = 'BY CHIP, KY R5'
moriniaAdvanced Analytics AnalystAsked:
Who is Participating?
 
Rgonzo1971Commented:
Hi,

pls try

SUBSTR(FIELDA,LENGTH(FIELDA))

Open in new window

Regards
0
 
John TsioumprisSoftware & Systems EngineerCommented:
I am not familiar with SAS but i reckon that there should be some text manipulation functions...
One way would be to reverse the string and take the 1st character...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.