/* isdsn Daniel Brockman 110921 Test for the existence of dataset */ %macro isdsn(dsn) ; /* = 1 if dataset &dsn exists /* = 0 otherwise /* dsn = library.name of a dataset /* Example: /* %if (1=%isdsn(work.yayb)) %then %do; /* data work.roscoe ; /* set work.yayb ; /* if (note_dt>'31-Dec-2009'd) ; /* run; /* %end; /* */ %if %sysfunc(exist(&dsn)) %then %let yesno=1 ; %else %let yesno=0 ; &yesno %mend isdsn;