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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 532 views
  • 0 likes
  • 2 in conversation