Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 342
  • Last Modified:

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'
0
morinia
Asked:
morinia
1 Solution
 
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
 
Rgonzo1971Commented:
Hi,

pls try

SUBSTR(FIELDA,LENGTH(FIELDA))

Open in new window

Regards
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.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now