In reply to CuriousMe.

Since the EXIST function returns a 0 if the member does not exist, you can check for that in the condition:

%if %sysfunc(exist(work.class)) = 0 %then %do;
data class; set sashelp.class; run;
%end;
%else %do;
%PUT Note: Already exists!;
%end;