Am looking for a piece of code, preferably OS independent and macro based, for deleting a text file (or any file for that matter)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From SAS documentation:
It’s essentially OS independent, in that it will work on multiple OS’s. You can’t ever have true independence since the fileref would be OS-dependent, but if you specify that as an argument it shouldn’t be a problem.
As a macro, you would use FDELETE in a SYSFUNC block:
However, myfile needs to be a fileref, so if you were using only the file’s actual physical location as an argument you’d need two steps: