Help using Base SAS procedures

Multiple files that start with same name using Proc DOWNLOAD

Reply
Frequent Contributor
Posts: 82

Multiple files that start with same name using Proc DOWNLOAD

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
Super Contributor
Super Contributor
Posts: 3,174

Re: Multiple files that start with same name using Proc DOWNLOAD

Posted in reply to SASHunter
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
Frequent Contributor
Posts: 82

Re: Multiple files that start with same name using Proc DOWNLOAD

Posted in reply to SASHunter
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
Super Contributor
Super Contributor
Posts: 3,174

Re: Multiple files that start with same name using Proc DOWNLOAD

Posted in reply to SASHunter
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
Frequent Contributor
Posts: 82

Re: Multiple files that start with same name using Proc DOWNLOAD

Posted in reply to SASHunter
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
Super Contributor
Super Contributor
Posts: 3,174

Re: Multiple files that start with same name using Proc DOWNLOAD

Posted in reply to SASHunter
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.
Frequent Contributor
Posts: 82

Re: Multiple files that start with same name using Proc DOWNLOAD

Posted in reply to SASHunter
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
Ask a Question
Discussion stats
  • 6 replies
  • 141 views
  • 0 likes
  • 2 in conversation