BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi

Is it possible to export to a FTP site, all i want to do is simply upload 5 files,
Files=01-05,
Host=example.com
username=user
password=pass

Thanks
5 REPLIES 5
LinusH
Tourmaline | Level 20
See the online doc for FILENAME FTP statement (if you want to do it within SAS). Otherwise you can create a shell script with your ftp commands, which you can call from a SAS session using the X statement.

Regards,
Linus
Data never sleeps
deleted_user
Not applicable
The example on the online says:
"This example creates a file called test.dat in a directory called c:\remote for the user bbailey on the host winnt.pc.

filename create ftp 'c:\remote\test.dat'
host='winnt.pc'
user='bbailey' prompt recfm=v;

data _null_;
file create;
do i=1 to 10;
put i=;
end;
run;
"

So i changed it to be:
filename create ftp '\\Daily\yyyymmdd\File01.xls'
host='example.com'
user='user' pass='pass' recfm=v;

data _null_;
file create;
do i=1 to 10;
put i=;
end;
run;
"

But to no success
And how does it know what data source the file to be created is called?
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
The DATA step, in general, is the source, even if there is no SET statement. Suggest you set the FILEMSGS option for more complete diagnostics. Also, you should consider sharing SASLOG output (and local/foreign FTP environments, SAS version info) for more accurate assistance/guidance from forum members -- your first DATA step should have worked fine, presuming you are able to FTP to that machine outside of SAS, with native FTP client on your OS platform. Recommend that you first confirm you are able to use FTP (native), and then with FILEMSGS set, test FTP under SAS.

Scott Barry
SBBWorks, Inc.
deleted_user
Not applicable
Hi

I have come back to this problem...i had a break on some other work, but back on it now.
If my file i want export is called fred1 how do i export this to the FTP site above?

thanks
LinusH
Tourmaline | Level 20
I suggest you first try to ftp a file from the directory that you are starting SAS from. If you succeed with that, go on using the diagnostics Scott talks about in the previous message.

/Linus
Data never sleeps

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
  • 774 views
  • 0 likes
  • 3 in conversation