BookmarkSubscribeRSS Feed
sfffdg
Obsidian | Level 7

Hi,

 

I have to replace PQR  and -00(basically the number after hyphen ,  - 00 should alsoconsider if any spaces after hyphen  and before 00) to space.

address=  "7 12-00 ABC XYZ RD PQR BEACH QLD 1234".

 

I have used the below expression  to replace PQR with  space.

prxchange('s/\b(PQR)\b//i',-1,address).

 

Neeed help with how to replace -00(should alsoconsider any spaces between hyphen and 00)

 

1 REPLY 1
ChrisNZ
Tourmaline | Level 20

Your need is unclear. Like this?

prxchange('s/\b(PQR|-\s*\d*)\b/ /i', -1, ADDRESS).

 

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 16. 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
  • 1 reply
  • 401 views
  • 0 likes
  • 2 in conversation