DATA Step, Macro, Functions and more

How to remove observations with mixed case names?

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 122
Accepted Solution

How to remove observations with mixed case names?

Hi,

 

I have a dataset where I have names in upper case and mixed case. I only want to retain observations with upper case names.

 

ID Name

1  John Doe1

2 JOHN DOE

3 JOHN DOE1

4 John Doe2

 

Desired output:

 

ID Name

2 JOHN DOE

3 JOHN DOE1

 

Please help.


Accepted Solutions
Solution
‎03-28-2016 04:48 PM
Super User
Posts: 17,963

Re: How to remove observations with mixed case names?

[ Edited ]

UPCASE() function

 

if name ne upcase(name) then delete;

 

ANYLOWER() function

 

if anylower(name) > 0 then delete;

 

View solution in original post


All Replies
Solution
‎03-28-2016 04:48 PM
Super User
Posts: 17,963

Re: How to remove observations with mixed case names?

[ Edited ]

UPCASE() function

 

if name ne upcase(name) then delete;

 

ANYLOWER() function

 

if anylower(name) > 0 then delete;

 

Frequent Contributor
Posts: 122

Re: How to remove observations with mixed case names?

Thank you!

Respected Advisor
Posts: 4,663

Re: How to remove observations with mixed case names?

Please mark @Reeza's answer as Accepted.

PG
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 223 views
  • 2 likes
  • 3 in conversation