Yes, I have. It is said that label statements can be applied, period, but not how. I tried: output out = summary0_&d / label = 'panel&d' ; /* syntax error */ output out = summary0_&d label = 'panel&d'; /* syntax error */ output out = summary0_&d / autolabel ; /* no syntax error, but no label in the file either */ What works of course is the stupid solution: to add the labelling variable in a separate data step (see code below). My post is asking for a more elegant way --- which I presume exists. %macro panel_stat; %do d = 0 %to &n_panel; proc means data = panel0_&d noprint; var psqt psqt_aav psqt_aav2 aav aav2 t_panel yhat_sum yhat_midl1-yhat_midl&n_prod; output out = summary0 ; run; data summary0_&d; set summary0; panel = &d; run; %end; data summary0_&bas_aar; merge summary0_0-summary0_&n_panel; by panel; run; proc export data = summary0_&bas_aar OUTFILE = "summary0_&bas_aar" DBMS = xlsx REPLACE; run; %mend; %panel_stat;
... View more