Hi,
I would like to make an if condition like if PRXMATCH(..., var1)>0 then delete. I would like to remove all cases in which I have:
Thanks in advance!
Do you want to delete the observations where any of those three strings occur or do you want to delete the 'dd' part of the posted strings?
Like this?
data have;
input string $20.;
datalines;
abc0,00ddabc
abcabc
defdef
abcdef454dd
0,234ddabcdef
;
data want;
set have;
if not prxmatch('/0,00dd|454dd|0,234dd/', string);
run;
What if I have different numbers before dd? I wrote these numbers with dd only like an example. I want remove all cases in which dd is after numbers.
Ah ok. Do this. This looks for patterns where the string 'dd' is after at least 1 digit.
data have;
input string $20.;
datalines;
abc0,00ddabc
abcabc
defdef
abcdef454dd
0,234ddabcdef
;
data want;
set have;
if not prxmatch('/\d+dd/', string);
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.