O'Reilly logo

Practical and Efficient SAS Programming by Martha Messineo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4: The Macro Facility

Introduction

Understanding Macro Variables

Using the “Dot” in Macro Variable Names

Determining How Many &s to Use

Understanding Quotation Marks

Using Macro Quoting

Unquoting

Forcing Single Quotation Marks

Writing Macros

Using Autocall Macros

Determining When to Write a Macro

Wrapping Long Lines of Code

Using the IN Operator

Testing for Blanks

Validating Parameters

Creating Macro Functions

Introduction

I rarely write a SAS program that doesn’t contain macro variables and macros. Macros enable you to take more control over your programs: passing values from one part of the program to another, conditionally executing sections of code, running the same piece of code multiple times, and performing countless other tasks. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required