Yes, I see what you mean but let me clarify one thing. Alist is the name of the variables and the report macro will be invoked using the values of the variables. The values will change with each row of the dataset. Alos, if I replace Var1, Var2, Var3... with mvarname I will pass too many parameters to the macro. In other words. %Let Alist = Var1, Var2, Var3,....; %macro report (Par1, Par2, Var1, Var2, Var3...) ... mend; /*these statements get built dynamically using a data step (see below)*/ %report (Par1Value1, Par2Value1, Var1Value1, Var2Value1, Var3Value1,...); %report (Par1Value2, Par2Value2, Var1Value2, Var2Value2, Var3Value2,...); ... /*the data set that dynamically builds the report macro statement*/ data _null_; set dataset; &Array1.; &Array2.; &Array3.; &Array4.; &Array5.; by SortedVariable; if first.SortedVariable then do; sr= cat('%report(', Par1, ',',Par2, ',',catx(',',&alist.),')'); put sr=; rc=dosubl(sr); end; run;
... View more