*Copyright @ www.mycsg.in;


Understanding macro variables in SAS

Why do we need macro variables

Concept Definition
Macro variable A macro variable stores text that can be substituted into SAS code dynamically.
User defined macro variable A macro variable created by the programmer to store a custom value.
System defined macro variable A macro variable automatically provided by SAS to hold environment information such as date, time, or user id.

Create sample data

Create and use a user defined macro variable

Examples of system defined macro variables

Use macro variables in titles and labels

Use macro variables with iterative processing

Key points to remember