The FDELETE function will do what you want: FDELETE
This is best done by using the appropriate operating system command with the necessary options. Since you seem to have Windows underneath your SAS, use "del".
Try this:
filename oscmd pipe "del '&CARPETA.\&SERIE.' /f 2>&1";
data _null_;
infile oscmd;
input;
put _infile_;
run;
The single quotes might be necessary if blanks appear in the path.
Thanks for the detailed answer Kurt. However I got 3 Error messages, from which these two are very particular:
ERROR: Insufficient authorization to access PIPE.
ERROR: No logical assign for filename OSCMD.
This means that, sadly, your SAS administrator has not enabled the XCMD system option. Either you get him/her to enable that, or you use the macro linked to by @Reeza
FDELETE to delete files and an empty folder.
Macro to recursively delete files using FDELETE
https://www.sascommunity.org/mwiki/index.php?title=Recursively_Delete_Files
Or use XCMD and a command line statement.
@PReintsch wrote:
Hello guys! I am new utilising SAS Enterprise Guide and I have been frustrating over this,
My Libraries and OUTPUT folders have been created this way:
options dlcreatedir;
libname OUTPUT "&CARPETA.\&SERIE.";
where, &CARPETA is a path and &SERIE is the name of the FOLDER.
After all the regressions are done, the FOLDER called 'SERIE' contains:
- SAS tables; aaa.sas
- Excel file; bbb.xlsx
I want to DELETE the FOLDER 'SERIE' completely.
I have tried deleting what is inside first, but I just managed to delete the SAS tables only. Is there a way to delete the FOLDER itself at once? In case it is not posible, how can I delete the excel file? Please!!!
Greetings!
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.