Solved

Extracting last character from a text field in SAS

Posted on 2016-10-12
2
19 Views
Last Modified: 2016-10-13
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
Comment
Question by:morinia
2 Comments
 
LVL 13

Expert Comment

by:John Tsioumpris
ID: 41841413
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
 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 41841423
Hi,

pls try

SUBSTR(FIELDA,LENGTH(FIELDA))

Open in new window

Regards
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Owning a franchise can be the dream of a lifetime. It provides a chance for economic growth. You can be as successful as you want.  To make your franchise successful, you need to market it successfully. Here are six of the best marketing strategies …
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now