08-01-2017 07:52 AM
Is there anyone who has experience with converting from FTP to SFTP?
I need make the following code to work by using SFTP.
Length x $100.;
x='OPEN ORA_WSMOD'; output; /* FTP SERVER*/
x='xxxxx'; output; /* USERNAME*/
x='xxxxxx'; output;/* PASSWORD*/
x='cd ftp_out'; output; /* FTP-FOLDER*/
x='lcd c:\temp'; output; /* OUTPUT FOLDER*/
x='PUT filename1.txt'; output; /* The filename */
x='PUT filename2.txt'; output; /* Another filename*/
set WORK.SCR end=EFIEOD;
%let _EFIERR_ = 0;
%let _EFIREC_ = 0;
file 'c:\temp\scr.txt' delimiter='09'x DSD DROPOVER lrecl=32767;
format x $100. ;
if _n_ = 1 then
EFIOUT + 1;
put x $ ;
if _ERROR_ then call symput('_EFIERR_',1);
If EFIEOD then
option XWAIT XSYNC;
X 'ftp -s:c:\temp\scr.txt';
08-01-2017 02:09 PM
Is there a reason that you're not using FILENAME FTP? That might be a little more straightforward to code.
There is also a method for FILENAME SFTP. As this involves a secure connection, you need an SSH client. From the doc:
You must have the applicable client software installed to use the SFTP access method. The SFTP access method supports only the following SSH clients.
08-02-2017 02:00 AM
08-02-2017 08:48 AM
You definitely need Putty to be installed wherever SAS is running, so if your SAS session is on a remote Windows machine, you'll need the SSH client to be there.
I assume that whatever FTP endpoint you're connecting to is already running an SFTP server to support secure connections/transmissions.
08-04-2017 03:03 AM
08-04-2017 08:10 AM
Yes, there are a few steps -- since you asked, I decided to check in our SAS Tech Support notes. I think that everything is documented here: