17 %macro mp_searchcols(libs=sashelp
22 %put &sysmacroname process began at %sysfunc(datetime(),datetime19.);
26 create table _data_ as
27 select distinct upcase(libname) as libname
28 , upcase(memname) as memname
29 , upcase(name) as name
30 from dictionary.columns
31 %
if %sysevalf(%superq(libs)=,
boolean)=0 %then %
do;
32 where upcase(libname) in (
"IMPOSSIBLE",
34 %
do x=1 %to %sysfunc(countw(&libs));
35 "%upcase(%scan(&libs,&x))"
43 length cols matchcols $32767;
44 cols=upcase(symget(
'cols'));
45 colcount=countw(cols);
46 by libname memname name;
48 putlog
"Searching libs: &libs";
49 putlog
"Searching cols: " cols;
51 if first.memname then
do;
56 if findw(cols,name,,
'spit') then do;
58 matchcols=cats(matchcols)!!' '!!cats(name);
60 if last.memname then do;
61 if sumcols>0 then output;
62 if sumcols=colcount then putlog "Full Match: " libname memname;
64 keep libname memname sumcols matchcols;
67 proc sort; by descending sumcols memname libname; run;
69 %put &sysmacroname process finished at %sysfunc(datetime(),datetime19.);