Sometimes, doing simple things is complicated in SAS. Using SQL, you could do:
%macro createFruit;
proc sql noprint;
select count(*) into :cmd
from dictionary.tables
where libname="WORK" and upcase(memname) = "FRUIT";
%if not &cmd %then %do;
create table fruit (name char(20));
%end;
quit;
%mend createFruit;
%createFruit;
Note that option noreplace has no effect in the WORK Library.
... View more