Saturday, October 30, 2010

SAS - Macros

Macros are powerful tools used in SAS code which allow the execution of generic code applied to specific tables.
  • Macro variables
&name; /* Macro variable */
%name; /* Use of created macros or system macros */

Example:

%let city = "Barcelona";
TITLE "City: &city";

  • Generation of code by using macros
%macro b;
a
%mend;

proc print data=%b;
run;

No comments:

Post a Comment