To clarify are you looking to USE a macro function or to create a macro to do this. If you want to create a macro what do you envision as the input and what as the output? Some of the macro functions you'll can look into are: %scan %if %then %do Or you could just wap the compress function in a macro . You could always use a find or index function in a data _null_ step. Basically there's many ways to do this and it sounds a lot like a home work question to me. You should also move this thread to the macro language forum.
... View more