Thanks a lot. this is because before the model, we have to impute the data by MI and WOCF which is different by different visits. The issue has been fixed now. that's because there is another do loop which use i as index in %anova_wocf_mi macro. if i is replaced by jj, then the do loop will be fine. %macro loop;
%do jj=1 %to %sysfunc(countw(&vis,%str(-)));
%let visn=%scan(&vis,&jj, -);
%put &visn;
%ancova_wocf_mi(paramcd=NPS0203, avisitn=&visn., censornum=2, popoth=);
%end;
%mend loop;
%loop;
... View more