BookmarkSubscribeRSS Feed
Liangck
Calcite | Level 5

Hi all,

Suppose i have a senario that read external file from ftp and after reading it, i wish to made a deletion on that particular external file.

i tried FDELETE but seem it cant do so.

my colleage tell that fdelete function are only access to a local directory but not remote directory.

is there any other method to do so?

Seeking for help, thanks you. Apperciate its alot.

Regards

LiangCk.

3 REPLIES 3
dhana
Fluorite | Level 6

You can specify the delete command on the RCMD parameter of the filename statement.

FILENAME FILEREF FTP "ABC.DAT" HOST="TESTHOST" USER="USERNAME" PASS="PASSWORD" RCMD="DELE ABC.DAT";

otherwise you  can try this also

QUOTE RCMD DLTF FILE(mylib/myfile)

mylib is the name of the library from which the file is to be deleted. myfile is the name of the file to be deleted.

Hope this helps...!

Thanks

Dhanasekaran R

Ksharp
Super User

Firstly , make sure you have right to deleting files at ftp .

And also you can use OS command to delete it.

Start-> Run-> cmd-> ftp 10.1.2.2 -> del ....

Maybe it should be worked.

Ksharp

Liangck
Calcite | Level 5

Hi DHNA and Ksharp

     thanks for your advice, i done it with fdelete alreadly..

     the code like this

filename fileDel ftp "&&SAS_Import&&Note&I&&Data_Upload&&Docm&J"

     host=&ftpHost 

     user=&ftpUser pass=&ftpPass

     prompt;

%let rc = %sysfunc(fdelete(fileDel));

     Thanks anyway.Apperciate your help.

Regards:

Liangck

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 2279 views
  • 6 likes
  • 3 in conversation