BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
dcortell
Pyrite | Level 9

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?

1 ACCEPTED SOLUTION

Accepted Solutions
dcortell
Pyrite | Level 9

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

4 REPLIES 4
Reeza
Super User

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?


 

dcortell
Pyrite | Level 9

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

dcortell
Pyrite | Level 9

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;

s040293
Calcite | Level 5
It works magically, thank you!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 4171 views
  • 0 likes
  • 3 in conversation