Hey guys,
I am new to macros. I'm having trouble getting it to run properly. &q resolves into either a 0 or 1. Whenever is resolves to a one then d=1, I then want it to assign variable1 the variable Count_parameter so I can use it in the bottom macro. If &q resolves to 0 then I want there to be no variable name in the parameter so that it is missing. However whenever I run it regardless of the value of d the variable one is always missing and then the parameters are missing from the next macro. I know this is because of the way SAS compiles, but I don't know how to fix it. Thank you!
%Let C1=Count_Parameter
d=&q;
%IF d=1 %THEN %DO;
%let variable1=&C1;
%END;
%Else %DO;
%let variable1= ;
%END;
%macroexample(var=variable1);