BookmarkSubscribeRSS Feed
Chip
Calcite | Level 5
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!
5 REPLIES 5
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.
Chip
Calcite | Level 5
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;
Gaurav
Calcite | Level 5
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'
Chip
Calcite | Level 5
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;
Chip
Calcite | Level 5
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;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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