Defining and Calling a Macro

A macro definition stores text. This might include macro language statements or expressions as well as complete or partial SAS program statements or program steps. The macro definition begins with a %MACRO statement and ends with a %MEND statement.

Defining a Macro

%MACRO and %MEND Statements Syntax

In order to create a macro program, you must first define it. You begin a macro definition with a %MACRO statement, and you end the definition with a %MEND statement.
Syntax, %MACRO statement and %MEND statement:
%MACRO macro-name;
text
%MEND <macro-name>;
macro-name
names the macro. The value of macro-name can be any valid SAS name that is not a reserved word in the SAS macro facility.
text
can ...

Get SAS Certified Professional Prep Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.