Hello @Feyng819,
The simplest way to combine the two replacements would be to apply the second PRXCHANGE function call to the result of the first, i.e., replace "variable" in the second call with the entire prxchange(...) expression of the first. In this particular case, however, it is also possible to use the OR operator (|) like this:
prxchange('s/^The\b|\bworld\b//',-1,variable);
This would remove the word "The" from the beginning of the string in variable as well as all occurrences of the word "world". (Note the case-sensitivity without the "i" modifier at the end of the regular expression.)
Hello @Feyng819,
The simplest way to combine the two replacements would be to apply the second PRXCHANGE function call to the result of the first, i.e., replace "variable" in the second call with the entire prxchange(...) expression of the first. In this particular case, however, it is also possible to use the OR operator (|) like this:
prxchange('s/^The\b|\bworld\b//',-1,variable);
This would remove the word "The" from the beginning of the string in variable as well as all occurrences of the word "world". (Note the case-sensitivity without the "i" modifier at the end of the regular expression.)
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.