hi,
suppose I have the following table:
| text |
|---|
| The generalized general idea |
| Hon. member |
| some text |
In every cell, whenever they are present, I would like to delete the following elements: 'The' , 'general' , 'Hon.' .
So the table becomes the following:
| text |
|---|
| generalized idea |
| member |
| text |
Thank you!
data have;
input text $50.;
cards;
The generalized general idea
Hon. member
some text
;
run;
data want;
set have;
_text=prxchange('s/Hon.|some|the|general\b//i',-1,text);
run;
https://communities.sas.com/thread/76418 is a similar thread, you may get some ideas.
data have;
input text $50.;
cards;
The generalized general idea
Hon. member
some text
;
run;
data want;
set have;
_text=prxchange('s/Hon.|some|the|general\b//i',-1,text);
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 save with the early bird rate—just $795!
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.