The SAS macro language is very powerful and requires skill to use effectively. Many good examples of SAS macros can be found online in various places, including proceedings of SAS Users Group conferences, which are posted at www.sas.com/techsup/download/stat/. For example, the xmacro.sas file contains many useful remarks and safeguards that can help you become an expert macro programmer.