BookmarkSubscribeRSS Feed
SASHunter
Obsidian | Level 7
Hi,

Is there a way to write the PROC DOWNLOAD statement where you can download multiple files from a directory on the server and you don't need to fully qualify the name of the file(s) to be downloaded?

Example:

rsubmit;
libname rhost '/cpspb/home/hunte022';

proc download inlib=rhost
outlib=lhost;
select capi* cati* / memtype=data;
run;

/* %sysrput download_rc=&sysinfo; */

/* check if download successful */
%if &sysinfo=0 %then
%put ** -- DOWNLOAD COMPLETED SUCCESSFULLY!;
%else %put ERROR: DOWNLOAD failed, File is not available.;

endrsubmit;

I want to download every file that starts with capi* and cati* from the UNIX machine to a directory on my local machine.

Thanks for any advise here.

Nancy
6 REPLIES 6
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Consider this info on PROC DOWNLOAD SELECT statement, directly from the SAS DOC:

http://support.sas.com/documentation/cdl/en/connref/61908/HTML/default/a000365273.htm


Scott Barry
SBBWorks, Inc.

Google advanced search argument, this topic/post:

proc download select statement site:sas.com
SASHunter
Obsidian | Level 7
Thanks Scott,

That was just what I needed!

New SAS code:

rsubmit;
libname rhost '/cpspb/home/hunter';

proc download inlib=rhost
outlib=lhost;
select capi: cati: / memtype=data;
run;

/* %sysrput download_rc=&sysinfo; */

/* check if download successful */
%if &sysinfo=0 %then
%put ** -- DOWNLOAD COMPLETED SUCCESSFULLY!;
%else %put ERROR: DOWNLOAD failed, File is not available.;

endrsubmit;


Nancy
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
You will want to check SAS support website HOTFIX maintenance, specific to PROC DOWNLOAD.

Scott Barry
SBBWorks, Inc.

Recommended Google advanced search argument, this topic/post:

+"proc download" +error +hotfix site:sas.com
SASHunter
Obsidian | Level 7
Scott,

So are you saying there could be a possible problem when downloading multiple files thru one PROC DOWNLOAD statement?

Is this fixed in SAS 9.2?

Nancy
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
No, not specifically. I am suggesting you (or your SAS admin) will want to keep up with HOTFIX maintenance. And if you see any particular items or SAS support notes with a related HOTFIX, then pursue it if you need to.

Or, maybe this concern is not warranted and your SAS admin diligently keeps up with SAS maintenance - that's for you to assess.

Scott Barry
SBBWorks, Inc.
SASHunter
Obsidian | Level 7
OK, thanks. I think they keep us up to date. Well, kind of - I once had to tell them of a hot fix that was needed, because of an error I was getting.

Thanks for the info. I will check out the site.

Nancy
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 2493 views
  • 0 likes
  • 2 in conversation