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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 483 views
  • 0 likes
  • 2 in conversation