From %Macro to %Mend: An Introduction to the SAS Macro Language
Presented: Tuesday September 4, 2018, 8:00am-5:00pm
Josh Horstman is an independent statistical programmer based in Indianapolis with 20 years’ experience using SAS in the life sciences industry. He specializes in analyzing clinical trial data, and his clients have included major pharmaceutical corporations, biotech companies, and research organizations. A SAS Certified Advanced Programmer, Josh loves coding and is a frequent presenter at SAS Global Forum and various regional and local SAS users group. Josh holds a bachelor’s degree in mathematics and computer science, and a master’s degree in statistics from Colorado State University.
This one-day course is designed for SAS programmers who are new to the SAS Macro Language. We will start with the basics and cover the fundamentals necessary to start applying SAS macros in your programs. By the end of the day, you will understand how the Macro Language works, what the macro symbol table is and how values are stored in it, how the SAS System uses macro variables, key Macro Language concepts, important SAS Macro Language statements, and how to invoke macros in your programs. The example Macros shown in the course materials demonstrate the power and flexibility of this part of the SAS System and will enable you to apply the functionality of the Macro Language to your own programs right away. This seminar was developed, copyrighted, and previously taught by Art Carpenter. For this presentation it has been licensed to be taught by Josh Horstman.
Intended Audience: Beginning to early intermediate
Tools Discussed: Base SAS
Prerequisite: This class is suited for the SAS user who already has a basic understanding of DATA steps and PROC steps, but is new to the Macro Language facility in SAS System software. It is a beginning-level course that assumes no prior understanding of the SAS Macro Language. It is also suitable for SAS users who want to understand the macros found in programs that have been “inherited” from other programmers.
- Introduction to the macro language
- Defining and using macro variables
- Calling and executing macros
- Using macro parameters
- Passing parameters between macros
- Conditional macro logic
- Macro %DO loops
- Macro comments
- Understanding macro processing scopes
- Using SQL and macro variables
- Macro text functions
- Numeric operations in the macro language