Using Macro Parameters
You have seen the basic form for a macro definition.
Your macros often contain macro variables. To make your macros more
dynamic, you could use the %LET statement to update the values of
the macro variables that are used within the macros. However, parameter
lists in your macro definitions enable you to update the macro variables
within your macro programs more conveniently. A parameter list is
an optional part of the %MACRO statement that names one or more macro
variables whose values you specify when you call the macro.
Example
Suppose the compiled
macro
Printdsn
contains references
to the macro variables dsn
(which records
a data set name) and vars
(which records
a list of data set variables), as follows: %macro printdsn; ...
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.