05-30-2015 08:22 AM
Please, we want to do in sas these actions :
Action 1: Deleting all folders in one directory
when I use this code :
When I use this code, I get a message : Cannot Delete folder: The directory is not empty
Action 2: I have a directory : Dir
It has a folders and files:
We want only to delete the files : f1, f2,f3,...fn
05-30-2015 09:23 AM
Thank you for your message.
Yes, you're right, but I do not want to use a OS Commands( I forget to say that).
I want only a sas program, because, it will run on many os.
06-01-2015 07:02 AM
define "many OS".
The numbers of platforms supported by SAS is not that big, anyway. Most of the time you will only have to cover Windows and UNIX.
06-01-2015 08:16 AM
Also, just to add there, do you think it really a good idea to be deleting things in this way. You have mentioned that you are getting errors already.
There are several reasons:
- Why are the folders there in the first place. If there is a reason, why remove them and re-create them?
- Why not use a version control system, this will keep the history and have roll-back functionality.
- If this is routine process, then have IT setup a file removal/batch job.
Personally I really don't like a language like SAS controlling my file system, there are processes for that type of thing.