Chapter 9. Macros: Reusable Programming


In Chapter 3 we looked at the idea of macro variables, those that SAS sets up for you and the ones you can create yourself. Although these variables are very powerful, they are only a small part of the SAS macro facility.

In this chapter we look first at how you can make any program reusable by converting it into a SAS macro. We also discuss how you can make your macros more flexible by passing parameters to them and by using conditional processing.

Then we see how you can use macros to apply some of the techniques we have examined in this book. We also make a SAS Enterprise Guide task into a macro so that we can reuse it.

Finally, we look at a way of getting SAS to create macro variables for us ...

Get SAS® Programming for Enterprise Guide® Users now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.