Lisam,
You seem to have missed the %LET from your macro assignments.
Try:
%macro test(var);
%if &var=1 %then %LET d1_&var=1;
%else %LET d1_&var=0;
%if &var=2 %then %LET d2_&var=1;
%else %LET d2_&var=0;
%mend test;
You don't need the run statement since it is part of the data step and you're code is purely Macro language.
Hope this is enough for you.
Regards,
BPD
... View more