SAS FILTER QUESTION

Accepted Solution Solved
Reply
Super Contributor
Posts: 1,040
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: 17,784

Re: SAS FILTER QUESTION


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

Re: SAS FILTER QUESTION

Length() function returns the length of a string.

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

Contributor
Posts: 65

Re: SAS FILTER QUESTION

data Want;

input Code_Variable $;

if length(Code_Variable) eq 5;

cards;

10351

101

11223040

32421

10449900

;

☑ This topic is SOLVED.

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

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