19 %macro mf_existvarlist(libds, varlist
22 %
if %str(&libds)=%str() or %str(&varlist)=%str() %then %do;
23 %mf_abort(msg=No value provided to libds(&libds) or varlist (&varlist)!
24 ,mac=mf_existvarlist.sas)
27 %local dsid rc i var found;
28 %let dsid=%sysfunc(open(&libds,is));
30 %if &dsid=0 %then %do;
31 %put WARNING: unable to open &libds in mf_existvarlist (&dsid);
34 %if %sysfunc(attrn(&dsid,NVARS))=0 %then %do;
35 %put MF_EXISTVARLIST: No variables in &libds ;
40 %else %do i=1 %to %sysfunc(countw(&varlist));
41 %let var=%scan(&varlist,&i);
43 %if %sysfunc(varnum(&dsid,&var))=0 %then %do;
44 %let found=&found &var;
48 %let rc=%sysfunc(
close(&dsid));
49 %if %str(&found)=%str() %then %do;
54 %put Vars not found: &found;