diff --git a/all.sas b/all.sas index 1cb860a..ee58483 100644 --- a/all.sas +++ b/all.sas @@ -43,6 +43,60 @@ options noquotelenmax; %mend mf_abort; /** @endcond *//** + @file + @brief de-duplicates a macro string + @details Removes all duplicates from a string of words. A delimeter can be + chosen. Is inspired heavily by this excellent [macro]( + https://github.com/scottbass/SAS/blob/master/Macro/dedup_mstring.sas) from + [Scott Base](https://www.linkedin.com/in/scottbass). Case sensitive. + + Usage: + + %let str=One two one two and through and through; + %put %mf_dedup(&str); + %put %mf_dedup(&str,outdlm=%str(,)); + + Which returns: + + > One two one and through + > One,two,one,and,through + + @param [in] str String to be deduplicated + @param [in] indlm= ( ) Delimeter of the input string + @param [out] outdlm= ( ) Delimiter of the output string + +