21%macro mf_existvarlist(libds, varlist
26 %
if %str(&libds)=%str() or %str(&varlist)=%str() %then %do;
27 %put %str(WARN)ING: blank libds/varlist in mf_existvarlist;
32 %local dsid rc i var found;
33 %let dsid=%sysfunc(open(&libds,is));
35 %if &dsid=0 %then %do;
36 %put %str(WARN)ING: unable to open &libds in mf_existvarlist (&dsid);
44 %if %sysfunc(attrn(&dsid,NVARS))=0 %then %do;
45 %put MF_EXISTVARLIST: No variables in &libds ;
46 %let rc=%sysfunc(close(&dsid));
51 %else %do i=1 %to %sysfunc(countw(&varlist));
52 %let var=%scan(&varlist,&i);
54 %if %sysfunc(varnum(&dsid,&var))=0 %then %do;
55 %let found=&found &var;
59 %let rc=%sysfunc(close(&dsid));
60 %if %str(&found)=%str() %then %do;
65 %put Vars not found: &found;