BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ilikesas
Barite | Level 11

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!

1 ACCEPTED SOLUTION

Accepted Solutions
slchen
Lapis Lazuli | Level 10

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;

View solution in original post

2 REPLIES 2
slchen
Lapis Lazuli | Level 10

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;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to connect to databases in SAS Viya

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.

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