%SUPERQ() is probably the safest way to quote. %runrpt(&as_grp,%superq(lbl_1),%superq(lbl_2),&level,%superq(lbl_3)); Other things to consider is to modify the macro so that parameters where the values might have commas or other special characters are delivered with quotes around them. %runrpt(&as_grp,"&lbl_1","&lbl_2",&level,"&lbl_3"); As far as a quick method for generating a lot of macro calls from a data set I find that using SAS to write the code to a file is the easiest to work with. You can eyeball the file to make sure the code looks right. Open it and submit the first few lines. Or even take it and embed it in another program. filename code temp ; data _null_; set work.&dataset; file code ; put '%runrpt' / '(' access_grp / ',' label_1 :quote. / ',' label_2 :quote. / ',' lvl / ',' label_3 :quote. / ');' ; if getoption('DMS')='DMS' then put "dm 'ODSRESULTS;CLEAR';" / "dm 'CLEAR LOG;CLEAR OUTPUT';" ; run; %inc code / source2 ;
... View more