Production Ready Macros for SAS Application Developers File Reference

Checks whether a file exists in SAS Drive. More...

Go to the source code of this file.

Detailed Description

Returns 1 if the file exists, and 0 if it doesn't. Works by attempting to assign a fileref with the filesrvc engine. If not found, the syscc is automatically set to a non zero value - so in this case it is reset. To avoid hiding issues, there is therefore a test at the start to ensure the syscc is zero.


%put %mfv_existfile(/does/exist.txt);
%put %mfv_existfile(/does/not/exist.txt);
filepathThe full path to the file on SAS drive (eg /Public/myfile.txt)

SAS Macros

Related Macros

Allan Bowe

Definition in file