Macros from Beginning to Mend: A Simple and Practical Approach to the SAS® Macro Facility
MGS Associates, Inc.
The macro facility is an important feature of the SAS Language. Mastering this facility will enable the novice user to become an accomplished programmer. This tutorial session will use a building block approach taking the user from the most basic %LET statements to parameter driven, code generating macros that can save time and effort. The use of Macros will reduce the repetitiveness of manipulating data and will facilitate uniform and easy maintenance of the system. This paper will use step by step examples to show the user how to use macro substitution to provide simple yet powerful SAS code. The user will learn how to create variables on the fly, and how to use the macro facility to generate code as well as how to save sections of macro code for future use.
View the .pdf of this paper.