BookmarkSubscribeRSS Feed
Subrata_LS
Calcite | Level 5

I am trying to upload or download a file from SFTP. The sas code that I use for the job is

options  mlogic mprint obs=max formdlim='_'  source2 noxsync noxwait source=1;

%let id=user;

%let pw=xxxxxx;

data null;

file 'F:\Batch\getDATA.bat'; * the batch file;

put "ftp -s:%0";

put "goto END";

put "open something@abcd.com"; /*Host name*/

put "&id";

put "&pw";

put 'CD "USer/Test/file"';/* FTP path*/

put "LCD C:\Users\dwnld";/* Local Destination path*/

put "GET abcd.txt";/* File name*/

put "bye";

put ":END";

run;

for FTP. This is not working for SFTP. Can you please suggest the same using batch file for SFTP. I have tried with file name options as well. That is not working too.

1 REPLY 1
jakarman
Barite | Level 11

You are creating a batch file by yourself and than calling that batch-file. (not coded above)

The contents of that batchfile has nothing to do with SAS but is dedicated tool scritpting. If you know to handle anay tool you ca do this calling from SAS.

Do you want to used SAS instead of that, that is possible

SAS(R) 9.4 Statements: Reference  (filename FTP)

SAS(R) 9.4 Statements: Reference (filename sftp)

---->-- ja karman --<-----

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 438 views
  • 0 likes
  • 2 in conversation