This might do:
%macro logvars(dsn);
proc sql;
select cats("Log_",name) into :vlist separated by ' '
from dictionary.columns
where memname = upcase("&dsn") and TYPE="num";
quit;
data log_&dsn;
set &dsn;
array v _numeric_;
array lv &vlist;
do i = 1 to dim(v);
if v{i} > 0 then lv{i} = log(v{i});
end;
drop i;
run;
%mend;
... View more