When I run this macro, I get multiple overwritten notes for variables visit and parm in the SAS log. I am confused since these variables are dropped in the data step. How can I change the code so that visit and parm variables are not overwritten anymore?
data test;
merge test2(in=inA)
%macro merge(parm=,var=,and=);
test3(keep=PtID Visit parm value0
where=(parm="&parm" and visit="Baseline" &and)
rename=(value0=&var._0 ))
test3(keep=PtID Visit parm value valueChg valueChgPct
where=(parm="&parm" and visit="48 Month Follow-Up" &and)
rename=(value=&var._48 valueChg=&var.Chg valueChgPct=&var.ChgPct))
%mend;
%merge(parm=parm1,var=var1)
%merge(parm=parm2,var=var2)
%merge(parm=parm3,var=var3)
%merge(parm=parm4,var=var4)
%merge(parm=parm5,var=var5);
by Pt;
if inA;
drop visit parm;
run;
Multiple Log notes like this:
INFO: The variable visit on data set WORK.TEST3 will be overwritten by data set WORK.TEST3.
INFO: The variable parm on data set WORK.TEST3 will be overwritten by data set WORK.TEST3.
... View more