17%macro mf_existvarlist(libds, varlist
20 %
if %str(&libds)=%str() or %str(&varlist)=%str() %then %do;
21 %mf_abort(msg=No value provided to libds(&libds) or varlist (&varlist)!
22 ,mac=mf_existvarlist.sas)
25 %local dsid rc i var found;
26 %let dsid=%sysfunc(open(&libds,is));
28 %if &dsid=0 %then %do;
29 %put %str(WARN)ING: unable to open &libds in mf_existvarlist (&dsid);
32 %if %sysfunc(attrn(&dsid,NVARS))=0 %then %do;
33 %put MF_EXISTVARLIST: No variables in &libds ;
38 %else %do i=1 %to %sysfunc(countw(&varlist));
39 %let var=%scan(&varlist,&i);
41 %if %sysfunc(varnum(&dsid,&var))=0 %then %do;
42 %let found=&found &var;
46 %let rc=%sysfunc(close(&dsid));
47 %if %str(&found)=%str() %then %do;
52 %put Vars not found: &found;