Chapter 9. Macros: Reusable Programming

  • Introduction 190

  • What Is a Macro? 190

  • Converting a Program to a Macro 190

  • Converting a Task to a Macro 194

  • Complex Prompts 195

  • Choosing Your Path 199

  • Including Macros 201

  • The Biggest Exploding Pie 202

  • Summary 206

  • Where to Look for More Information 206

  • Exercises 206

Introduction

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. ...

Get SAS Programming for Enterprise Guide Users, Second Edition 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.