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.

Ready to join fellow brilliant minds for the SAS Hackathon?

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!
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
  • 884 views
  • 2 likes
  • 3 in conversation