Help using Base SAS procedures

string operation problem

Reply
Regular Contributor
Posts: 222

string operation problem


Hello everyone,

How to deal with string to keep only numeric and comma?

such as %let a=asd1,2,ggg3,678,thy%@#@;

I just need b=1,2,3,678

Thanks;

data one;

a="asd1,2,ggg3,678,thy%@#@;";

b=somefunction(a,'0123456789,');

run;

Grand Advisor
Posts: 16,926

Re: string operation problem

Super Contributor
Posts: 1,636

Re: string operation problem

data one;

a="asd1,2,ggg3,678,thy%@#@;";

b=compress(a,',','dk');

run;

proc print;run;

Ask a Question
Discussion stats
  • 2 replies
  • 127 views
  • 6 likes
  • 3 in conversation