20 %macro mf_existvarlist(libds, varlist
23 %
if %str(&libds)=%str() or %str(&varlist)=%str() %then %do;
24 %mf_abort(msg=No value provided to libds(&libds) or varlist (&varlist)!
25 ,mac=mf_existvarlist.sas)
28 %local dsid rc i var found;
29 %let dsid=%sysfunc(open(&libds,is));
31 %if &dsid=0 %then %do;
32 %put WARNING: unable to open &libds in mf_existvarlist (&dsid);
35 %if %sysfunc(attrn(&dsid,NVARS))=0 %then %do;
36 %put MF_EXISTVARLIST: No variables in &libds ;
41 %else %do i=1 %to %sysfunc(countw(&varlist));
42 %let var=%scan(&varlist,&i);
44 %if %sysfunc(varnum(&dsid,&var))=0 %then %do;
45 %let found=&found &var;
49 %let rc=%sysfunc(close(&dsid));
50 %if %str(&found)=%str() %then %do;
55 %put Vars not found: &found;