05-24-2012 04:40 PM
I have built a process for analysts that references macros from another group (I don't control). These macros write out a bunch of files that I don't want to hang on to. I can remove the datasets using PROC DATASETS but how can I get rid of the text files? I don't want to rely on users cleaning up after themselves. I am in a UNIX environment and sometimes the process will be run in batch and sometimes in EG so I can't just put in a UNIX command into the code. Is there a solution to this? Thanks.
05-24-2012 05:17 PM
I am in the windows world so I would usually do something like
x 'del \\servername\fileToBeDeleted.txt'
But I assume you could just insert the equivalent unix command...
05-24-2012 05:51 PM
There are functions called SAS File I/O functions. I think that's category.
FDELETE sounds helpful.
You might also look into ways of placing the files in /tmp location that will dissapear after the job ends. Not sure how to do that.
There is also the the FILENAME TEMP but it sounds like you don't have a hook into the (I don't control) code so that might not work.