Help using Base SAS procedures

Deleting Gif File. File Transfer.

Reply
Frequent Contributor
Posts: 78

Deleting Gif File. File Transfer.

Hi there,

I store my web pages and gif file in tis directory "/data/webserver/html/yen" and I would like to run a SAS script that will delete all the gif files in this directory. Just wondering how do I do that?

Also I would like to transfer three webpages from C:Temp/Yen to "/data/webserver/html/yen". How do I do that?

Hopin you can help me out. Thanks in advance!

Yennie
Valued Guide
Posts: 632

Re: Deleting Gif File. File Transfer.

The X statement (or one of its variations) might be a good place to start. It allows you to submit OS level commands from within a SAS program.
Super Contributor
Super Contributor
Posts: 3,174

Re: Deleting Gif File. File Transfer.

Consider using the called function FDELETE function either in a DATA step or you can invoke it using %SYSFUNC within a macro.

Scott Barry
SBBWorks, Inc.

Google advanced search argument, this topic / post:

fdelete site:sas.com
Frequent Contributor
Posts: 78

Re: Deleting Gif File. File Transfer.

Hi Scott,

The thing is that there are other files in this directory such a .gif, .jpeg, ,html and .txt. And I would only like to delete any files that end with .gif extension. and leave all other files alone.

With this Fdelete function, I have never tried using it before but does it allow me to only write it in way that it wll only delete files with .gif extension???

Also, just wondering is SAS able to do sort of like a FTP transfer? transfering files from one folder to another?

Hoping you can help.

Cheers.
Super Contributor
Super Contributor
Posts: 3,174

Re: Deleting Gif File. File Transfer.

You will need to use FILENAME with the "PIPES" option to read a directory and then use FDELETE to delete individual files; I don't expect FDELETE supports any wild-carding.

And, also, yes SAS supports FTP, using FILENAME with the FTP option.

Check your SAS companion guide for details. Also, the SAS support http://support.sas.com/ website has information about these techniques.

Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 4 replies
  • 147 views
  • 0 likes
  • 3 in conversation