Type: | Macro statement |
Restriction: | Allowed in macro definitions only |
%macro settax(taxrate); %let taxrate = %upcase(&taxrate); %if &taxrate = CHANGE %then %do; data thisyear; set lastyear; if sale > 100 then tax = .05; else tax = .08; run; %end; %else %if &taxrate = SAME %then %do; data thisyear; set lastyear; tax = .03; run; %end; %mend settax;
CHANGE
, then
the macro generates the following DATA step: