DATA Step, Macro, Functions and more

Delete csv file from home folder

Accepted Solution Solved
Reply
Contributor
Posts: 25
Accepted Solution

Delete csv file from home folder

Hi

 

I'm trying to delete a csv file from the home directory in sas

 

I was using

 

data_null_;

rc=fdelete("~/nameoffile.csv");

run;

 

but it seems not working

 

There is any command I can use for the scope?


Accepted Solutions
Solution
2 weeks ago
Contributor
Posts: 25

Re: Delete csv file from home folder

Solved with the following :

 

filename test "/r/ge.unx.sas.com/vol/vol110/u11/spndac/final_&dd&mm&yy..csv";

 

data _null_;
rc=fdelete('test');
put rc=;
run;

View solution in original post


All Replies
Super User
Posts: 23,778

Re: Delete csv file from home folder

Try using the full path?

 

The documentation seems to expect a fileref, not the path, did you try that approach?

 

http://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#p029yvwyao7xspn19x...

 


@dcortell wrote:

Hi

 

I'm trying to delete a csv file from the home directory in sas

 

I was using

 

data_null_;

rc=fdelete("~/nameoffile.csv");

run;

 

but it seems not working

 

There is any command I can use for the scope?


 

Contributor
Posts: 25

Re: Delete csv file from home folder

Hi

 

Tested both :

 

data _null_;
rc=fdelete("/r/ge.unx.sas.com/vol/vol110/u11/spndac/final_&dd&mm&yy..csv");
run;

 

 

data _null_;

ff=("/r/ge.unx.sas.com/vol/vol110/u11/spndac/final_&dd&mm&yy..csv");
rc=fdelete(ff);
run;

 

The files are still there

 

D

Solution
2 weeks ago
Contributor
Posts: 25

Re: Delete csv file from home folder

Solved with the following :

 

filename test "/r/ge.unx.sas.com/vol/vol110/u11/spndac/final_&dd&mm&yy..csv";

 

data _null_;
rc=fdelete('test');
put rc=;
run;

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 46 views
  • 0 likes
  • 2 in conversation