Deletes an external file
-
sysrc
-
contains the return code for the operation:
Type:
Numeric
-
fileref
-
is the fileref that was assigned to the
external file to be deleted.
Type: Character
You can use either the FILENAME statement or the FILENAME
function in SCL to assign a fileref. Under some operating systems, you can
also use system commands to assign filerefs.
Generate a fileref for an external file and assign it
to the variable FREF. Then call FDELETE to delete the file and call the FILENAME
function again to deassign the fileref.
length fref $ 8;
fref =_blank_;
/* Assign a fileref generated by the system */
/* to the physical filename that is stored */
/* in the variable FNAME. */
rc=filename(fref,fname);
if (rc=0) and (fexist(fref)) then
rc=fdelete(fref);
rc=filename(fref,'');
FEXIST
FILENAME
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.