Using SAS Macro Variables

%LET Statement

The SAS macro language enables you to design dynamic programs that you can easily update or modify.
A macro variable can be defined to represent a string of text that appears in your program. For example, if you reference a specific variable value in multiple places in a program, you can substitute a macro variable in its place. Then, if you want to update the value of the variable, you need to update the macro variable definition only once, rather than searching through your code to find the value in multiple places. It is common to place macro variable assignments at the top of SAS programs.
Use the %LET statement to create a macro variable and assign it a value.
Syntax, %LET statement:

Get SAS Certified Specialist Prep Guide 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.