Search notes:

SAS programming, function exist

The exist function can be used to check wheter a data set exists:
%macro doesTableExist(tab);

  %if %sysfunc(exist(&tab))
      %then %put Table &tab does indeed exist;
      %else %put Table &tab does not exist;

%mend;

%doesTableExist(tq84_tab);

data tq84_tab;
  x = 'foo';
  y = 'bar';
  z = 'baz';
run;

%doesTableExist(tq84_tab);

proc delete
     data = tq84_tab;
run;

%doesTableExist(tq84_tab);
Github repository about-SAS, path: /programming/functions/exist/check-existence-dataset.sas

See also

functions

Index