Previous Page | Next Page

SAS Component Language Dictionary

FDELETE



Deletes an external file
Category: External File

Syntax
Details
Example
See Also

Syntax

sysrc=FDELETE(fileref);

sysrc

contains the return code for the operation:

0

successful

[ne]0

not successful

Type: Numeric

fileref

is the fileref that was assigned to the external file to be deleted. The fileref cannot be associated with a list of concatenated filenames or directories. If the fileref is associated with a directory, a PDS or a PDSE, then the directory, PDS, or PDSE must be empty. You must have permission to be able to delete the file or directory.

Type: Character


Details

You can use either the FILENAME statement or the FILENAME function in SCL to assign a fileref. Under some operating environments, you can also use system commands to assign filerefs.


Example

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,'');


See Also

FEXIST

FILENAME

Previous Page | Next Page | Top of Page