Help using Base SAS procedures

select customized data format

Accepted Solution Solved
Reply
Super Contributor
Posts: 399
Accepted Solution

select customized data format

Hi, this is probably so easy for some.. But How can I select a field only if is in the format like alpha/numeric/alpha eg. M2H or G8R etc.. if I have GG5 or 4 or 66R .. etc. or anything else like this, I don't want it..
Thanks in advance


Accepted Solutions
Solution
‎08-09-2013 02:25 PM
Respected Advisor
Posts: 3,149

Re: select customized data format

data have;

input var $;

cards;

M2H

G8R

GG5

66R

;

DATA WANT;

  SET HAVE;

  IF PRXMATCH('/[a-zA-Z]\d[a-zA-Z]/',var) >0;

run;

Haikuo

View solution in original post


All Replies
Solution
‎08-09-2013 02:25 PM
Respected Advisor
Posts: 3,149

Re: select customized data format

data have;

input var $;

cards;

M2H

G8R

GG5

66R

;

DATA WANT;

  SET HAVE;

  IF PRXMATCH('/[a-zA-Z]\d[a-zA-Z]/',var) >0;

run;

Haikuo

Super Contributor
Posts: 399

Re: select customized data format

thank you


🔒 This topic is solved and locked.

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

Discussion stats
  • 2 replies
  • 132 views
  • 0 likes
  • 2 in conversation