Deletes an external file or an empty directory.
Category: | External Files |
See: | FDELETE Function: Windows in SAS Companion for Windows |
FDELETE Function: UNIX in SAS Companion for UNIX Environments | |
FDELETE Function: z/OS in SAS Companion for z/OS |
is a character constant, variable, or expression that specifies the fileref that you assigned to the external file. You can assign filerefs by using the FILENAME statement or the FILENAME external file access function.
Restriction | The fileref that you use with FDELETE cannot be a concatenation. |
Windows specifics | In some operating environments, you can specify a fileref that was assigned with an environment variable. You can also assign filerefs using system commands. For details, see the SAS documentation for your operating environment. |
is a character constant, variable, or expression that specifies an empty directory that you want to delete.
Restriction | You must have authorization to delete the directory. |
data _null_;
fname="tempfile";
rc=filename(fname,"physical-filename");
if rc = 0 and fexist(fname) then
rc=fdelete(fname);
rc=filename(fname);
run;