BookmarkSubscribeRSS Feed
InspectahDex
Obsidian | Level 7

I have a dataset with one variable that contains name information along with suffixes and titles. There are also commas and slashes and there are also blanks. It looks like this:

 

BusinessContact
Dr. Moon S. Park, FCAP
Stacy Petersen
Dr. Andrew Schwartz
Katie Bova
Ms. Melissa Guiba
Mr. Leonard Licina
OM is Shelly
W.M. Morrow
Business Managaer - Sandy Nikaitani
Mr. Kevin A. Roberts
Tracy Sawada
Faith
 
Mr. George Newton
Angie Bugaran
 
 
Chris
Henry Yim/Kelly Tuamoheloa
Ms. Merilyn Harris
Faith
Gerald McKenna, M.D.
Mr. Herbert Yim
Mr. Ira Walton
Ms. Orianna Skomoroch

 

How can I take that column and convert it into two where it's split out by First Name and Last Name with the titles (Mr., Mrs., Ms., Dr.) and suffixes (M.D., FCAP) excluded?

1 REPLY 1
ChrisNZ
Tourmaline | Level 20

You need to develop a step-by-step clean-up logic. This is an iterative process by trial and error. For example:

1. Remove titles

when that's done

2. split records with several names into several observations

then

3. extract name components as desired

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 335 views
  • 0 likes
  • 2 in conversation