Macros are an important and powerful tool offering within SAS. But do you need to write one? What is the efficient way of writing a macro? How do you assess the benefit accrued by writing one? Does the excitement of writing a macro outweigh the benefit of writing one? These are some questions that you should ask yourself before writing macros.
For a coder, the sheer exhilaration of writing a complex macro that automates multiple tasks may be the foremost reason for writing it. However, that shouldn’t be the only criterion. Do you need to write one? or Is creating a macro that tries to do a lot actually an inefficient use of the resources? Well, if the answer is that a macro is required, you may be better off writing multiple macros at times and nesting them if required into a single program file. Let’s say that you want to write a macro that...