Using User-Defined Macro Variables

The %LET Statement

You have seen that SAS provides a variety of automatic macro variables for you. You can also create your own macro variables.
The simplest way to define your own macro variables is to use a %LET statement. The %LET statement enables you to define a macro variable and to assign a value to it.
General form, %LET statement:
%LET variable=value;
Here is an explanation of the syntax:
variable
is any name that follows the SAS naming convention.
value
can be any string from 0 to 65,534 characters.
variable or value
if either contains a reference to another macro variable (such as &macvar), the reference is evaluated before the assignment is made.
Note: If variable already ...

Get SAS Certification Prep Guide, 4th 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.