CHAPTER 7

Writing Flexible Code with the SAS Macro Facility

7.1    Macro Concepts

7.2    Substituting Text with Macro Variables

7.3    Concatenating Macro Variables with Other Text

7.4    Creating Modular Code with Macros

7.5    Adding Parameters to Macros

7.6    Writing Macros with Conditional Logic

7.7    Writing Data-Driven Programs with CALL SYMPUT

7.8    Debugging Macro Errors

 

7.1 Macro Concepts

Not so long ago the SAS macro facility was considered an advanced topic relevant only to experienced SAS users. Over time, however, macros have become more prevalent so that now even new SAS users would do well to know a little about the SAS macro facility. Fortunately, the basic macro concepts are not difficult to understand. This chapter introduces ...

Get The Little SAS® Book: A Primer now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.