would replace Tuesday with Saturday, and replace Thursday with Sunday, returning "Monday Saturday Wednesday Sunday Friday".
It would also allow a null replacement string, which could be used to remove words:
would return "Monday Wednesday Friday"
Currently it can be done with TRANWRD or TRANSTRN, but it requires one function call for each replacement, which gets ugly when you want to replace several items, e.g.:
have="Monday Tuesday Wednesday Thursday Friday";
The proposed syntax is similar to the current TRANSLATE function, which can accept a list of to-from pairs, e.g.:
put string= string2=;
It would be great if ReplaceW could allow you to specify the word delimiter and modifiers to ignore case etc, but I can't see how to work those in given that all the arguments are character. Unless it veered off into a less SASsy syntax.
Most of the time when I do this I'm in a macro setting, and given a list of words, I want to remove some specific word(s). So I would be replacing the words with a null. If there were a CompressW function which accepted a list of words to be removed (rather than a list of characters), that would meet my usual need.