SAS FILTER QUESTION

Accepted Solution Solved
Reply
Super Contributor
Posts: 1,041
Accepted Solution

SAS FILTER QUESTION

Hello,

From the below character_variable I only want to pick the ones with 5 digits:

I want to eliminate the rest. Do I use Substring??

CODE_VARIABLE

10351

101

11223040

32421

10449900


Accepted Solutions
Solution
‎08-28-2015 11:40 AM
Super User
Posts: 19,771

Re: SAS FILTER QUESTION

Posted in reply to robertrao

All Replies
Solution
‎08-28-2015 11:40 AM
Super User
Posts: 19,771

Re: SAS FILTER QUESTION

Posted in reply to robertrao

Length() function returns the length of a string.

SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition

Contributor
Posts: 65

Re: SAS FILTER QUESTION

Posted in reply to robertrao

data Want;

input Code_Variable $;

if length(Code_Variable) eq 5;

cards;

10351

101

11223040

32421

10449900

;

🔒 This topic is solved and locked.

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

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