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.)
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.