- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 02-04-2016 02:41 PM
(2359 views)
There is a column Customer name with first and last names together. not all the values have both first and/or last names. Want to know how many of them truly have both first and last names. They are separated by spaces.
6 REPLIES 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can use COUNTW()
Example:
data want;
set have;
Fullname=(COUNTW(name)>1);
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
proc sql;
select "Full Names",sum(COUNTW(name)>1) as N
from have
;
quit;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
"Truly" is a strong word. What locale do your names belong to?
Data never sleeps
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
only way is to check the length before and after compressing the name. if they are equal then either names is missing,
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can count the words in a name but you can't accurately check if they have both first and last name.
For example is Bruce Roger two first names or a first name and a last name? Either of these names could be a first name or a last name.
Another: Van Hurst - is this a first name and a last name or a two word last name?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes that's what I was getting at.
You need a data quality tool like data flux to manage this.
You need a data quality tool like data flux to manage this.
Data never sleeps