BookmarkSubscribeRSS Feed
GokulShivananda
Obsidian | Level 7

Hi,

 

I'm doing some data cleansing and i have few words which act as a delimiter. I tried to get the data between two delimiters(Words) and i wasn't able to succeed.  

I used SCAN function where i cant use string/word as a delimiter. any suggestions/solutions are appreciated.

Thank you.

 

Regards,

Gokul SHIVANANDA

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

How about PRX?

 

data have(keep=string newstring);
   string = "one two three four five six";
   r = prxparse("/one (.*) five/");
   p = prxmatch(r, string);
   newstring = prxposn(r, 1, string);
run;
PaigeMiller
Diamond | Level 26

Show us a few examples. Show us the code you tried.

--
Paige Miller

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 536 views
  • 0 likes
  • 3 in conversation