BookmarkSubscribeRSS Feed
Yennie
Calcite | Level 5
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
4 REPLIES 4
ArtC
Rhodochrosite | Level 12
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.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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
Yennie
Calcite | Level 5
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.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4 replies
  • 1241 views
  • 0 likes
  • 3 in conversation