Help using Base SAS procedures

Subsetting data by minimum length of strings

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

Subsetting data by minimum length of strings

If I have a table like this:

Name1

A

AB

ABC

ABCD

ABCDE

ABCDEF

ABCDEFG

ABCDEFGH

How can I write a command to just subset the observations that have 6 or more characters in the string?


Accepted Solutions
Solution
‎07-13-2015 05:04 PM
Super User
Posts: 5,516

Re: Subsetting data by minimum length of strings

Posted in reply to SASbeginner20

Try this:

where length(varname) > 5;

Good luck.

View solution in original post


All Replies
Solution
‎07-13-2015 05:04 PM
Super User
Posts: 5,516

Re: Subsetting data by minimum length of strings

Posted in reply to SASbeginner20

Try this:

where length(varname) > 5;

Good luck.

🔒 This topic is solved and locked.

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

Discussion stats
  • 1 reply
  • 191 views
  • 1 like
  • 2 in conversation