Hi there,
I am using the following code to login to winscp ftp server and download one csv file into my network drive.
So, I am not sure where i am doing mistake.
If anybody knows, please suggest.
then I am submitting the following 2 lines of SAS Code.
%let dest = \\folder1\users\files\indata
%sysexec "C:\WinSCP\WinSCP.exe" /console /script:"&dest\FTP.txt" /command "get file1.prn &dest\file1.prn" "close" "exit";
FTP.txt file has the following code.
option batch on
option confirm off
open sftp://user:password@xx.x.xxx.xx.22
cd /a/b/c/csvfiles
But when i run the above code i am not getting the file into my local drive.
Any help will be appreciated.
Eshan
You don't give us much to go on (like, how doesn't it work?) Steps to troubleshoot this:
Thanks Snoopy for your reply.
I just realized that i do not have winscp installed in my system. So, I think i can't download the file from the ftp server. I think this could be the blocker.
The other thing is like you said i am trying to login to the sftp server from CMD in the following way.
sftp username@ipaddress
it prompted me to enter the password and i entered the password
But it says Permission denied<publickey, keyboard-interactive> along with a popup mesaage which says "SSH error occured, please contact administrator".
Snoopy, since you checked my code in %sysexec, do you think the sytax is correct. The purpose is i am trying to download a file from the ftp server into my dest path.
is the get command correct? if yest then i will try to install winscp and then i will try to run it and see how it goes.
The other important thing is the username and password that i am using are not mine, my team member provided his details for me to complete this task. I don't know how this affects.
In my code, in the ftp.txt, do i have to add the port(22) also to the server at the end.?
If you provide some clarification on my questions, it would really make me understand the whole process.
Thanks again.
Eshan
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.