Help using Base SAS procedures

Proc Download

Reply
Occasional Contributor
Posts: 16

Proc Download

There was a time when I was able to move SAS programs between our network drive and unix by using a FTP process. I'm pretty sure that way of moving programs has been eliminated by my company. I'm attempting to find a new way and was wondering if I could use proc download/upload. I'm getting an error trying to download. This is my code...

%signon(unix);

rsubmit;
OPTIONS MSTORED SASMSTORE=HOME;

filename locref 'z:\';
filename fref '/p02/data/penv/hgsa/intrnet';

proc download infile=fref('trend_12_graph.sas')
outfile=locref;
run;
endrsubmit;

This is my error...
ERROR: Invalid file, z:\.

I've tried a bunch of different file locations for locref but it always comes back as an invalid file. Any help is much appreciated.

Thanks!
Super Contributor
Super Contributor
Posts: 3,174

Re: Proc Download

Are you attempting to move SAS source code programs or a SAS compiled macro catalog. The FILENAME statement expects a specific file, not a folder/directory; a LIBNAME statement points to a folder/directory. Also consider the issue with moving catalogs / objects between disparate operating environments.

Scott Barry
SBBWorks, Inc.
Occasional Contributor
Posts: 16

Re: Proc Download

Thanks Scott and Gaurav! When I spelled out the outfile location, it worked.

rsubmit;
OPTIONS MSTORED SASMSTORE=HOME;

filename fref '/p02/data/penv/hgsa/intrnet';

proc download infile=fref('trend_12_graph.sas')
outfile='z:\test.sas';
run;
endrsubmit;
New Contributor
Posts: 2

Re: Proc Download

You may try using the following pseudo code to move your programs onto the local machine from the remote server.


filename locref 'c:\';
rsubmit;
filename fref '/local/programs';
proc download infile=fref('*.sas')
outfile=locref;
run;
endrsubmit;



This code would copy all the codes residing on the UNIX server under the directory '/local/programs'
Occasional Contributor
Posts: 16

Re: Proc Download

Thanks Scott and Gaurav! When I spelled out the outfile location, it worked.

rsubmit;
OPTIONS MSTORED SASMSTORE=HOME;

filename fref '/p02/data/penv/hgsa/intrnet';

proc download infile=fref('trend_12_graph.sas')
outfile='z:\test.sas';
run;
endrsubmit;
Occasional Contributor
Posts: 16

Re: Proc Download

Thanks Scott and Gaurav! When I spelled out the outfile location, it worked.

rsubmit;
OPTIONS MSTORED SASMSTORE=HOME;

filename fref '/p02/data/penv/hgsa/intrnet';

proc download infile=fref('trend_12_graph.sas')
outfile='z:\test.sas';
run;
endrsubmit;
Ask a Question
Discussion stats
  • 5 replies
  • 301 views
  • 0 likes
  • 3 in conversation