BookmarkSubscribeRSS Feed
user112a2
Obsidian | Level 7

I am trying to delete an XLSX file on the unix server and getting error messages. Below is my code. How can I delete this file in SAS EG? I need code to do this. Below are the error messages that I am getting.

 

 

 

Removed
2 REPLIES 2
Tom
Super User Tom
Super User

Are you sure the error is not just in response to the typo that caused you to have too long a name in the last FILENAME statement? "myfileclear" is 10 characters and filerefs (and librefs) can have a max of 8 characters.

 

You do not need to include keyword CLEAR to "close" a fileref.  Just issue the FILENAME statement without anything after the fileref name value.

r_behata
Barite | Level 11
filename myfile "<path>";
data _null_;
rc=fdelete("myfile");
run;
filename myfile clear;

No Issues running this code in SAS EG . You may have to verify the existence of the file on Path specified on the filename statement.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 947 views
  • 2 likes
  • 3 in conversation