Search notes:

SAS programming, function sysmsg

filename tq84_fil '/file/that/does/not/exist';

data _null_;
  f = fopen('tq84_fil', 'i');
  if f eq 0 then do;
     reason = sysmsg();
     put 'Could not open file for reading.';
     put 'Reason: ' reason;
  end;
run;
/*
Could not open file for reading.
Reason: ERROR: Physical file does not exist /file/that/does/not/exist
*/
Github repository about-SAS, path: /programming/functions/sysmsg/fopen.sas

See also

functions error handling

Index