<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Unable to download a csv file from WinSCP ftp server to local drive in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-download-a-csv-file-from-WinSCP-ftp-server-to-local/m-p/166126#M32030</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't give us much to go on (like, how doesn't it work?)&amp;nbsp; Steps to troubleshoot this:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;First, test the command line text in the command line by typing it by hand.&amp;nbsp; See if that gets your file.&amp;nbsp; If not, it's a WINSCP problem (either ftp.txt or something else is wrong).&lt;/LI&gt;&lt;LI&gt;Then, see what string is actually getting passed into %sysexec.&amp;nbsp; Instead of %sysexec'ing it, %let it to a macro variable, and %put that.&amp;nbsp; If that has errors, fix them.&lt;/LI&gt;&lt;LI&gt;Once it does not have errors, if the program still doesn't work, take the %put result and copy/paste it into CMD.&amp;nbsp; See if that works.&amp;nbsp; If not, see where it's different from your typed in code from the first step.&amp;nbsp; Consider the possibility of invisible characters (like 'A0'x ) causing trouble.&lt;/LI&gt;&lt;LI&gt;If it's the same code but it still doesn't work when %sysexec'ed but does work when pasted into CMD, then you may have some issues with %sysexec.&amp;nbsp; It's possible it's not permitted on your SAS server (it's often disabled).&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Dec 2013 20:15:13 GMT</pubDate>
    <dc:creator>snoopy369</dc:creator>
    <dc:date>2013-12-06T20:15:13Z</dc:date>
    <item>
      <title>Unable to download a csv file from WinSCP ftp server to local drive</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-download-a-csv-file-from-WinSCP-ftp-server-to-local/m-p/166125#M32029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the following code to login to winscp ftp server and download one csv file into my network drive.&lt;/P&gt;&lt;P&gt;So, I am not sure where i am doing mistake.&lt;/P&gt;&lt;P&gt;If anybody knows, please suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then I am submitting the following 2 lines of SAS Code.&lt;/P&gt;&lt;P&gt;%let dest = &lt;A href="https://communities.sas.com/"&gt;\\folder1\users\files\indata&lt;/A&gt;&lt;/P&gt;&lt;P&gt;%sysexec "C:\WinSCP\WinSCP.exe" /console /script:"&amp;amp;dest\FTP.txt" /command "get file1.prn &amp;amp;dest\file1.prn" "close" "exit";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="ftp://ftp.txt/"&gt;FTP.txt&lt;/A&gt; file has the following code.&lt;/P&gt;&lt;P&gt;option batch on&lt;/P&gt;&lt;P&gt;option confirm off&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;open s&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://communities.sas.com/ftp://user:password"&gt;ftp://user:password&lt;/A&gt;&lt;A href="mailto:password@xx.x.xxx.xx.22"&gt;@xx&lt;/A&gt;&lt;A href="mailto:password@xx.x.xxx.xx.22"&gt;&lt;/A&gt;&lt;A href="mailto:password@xx.x.xxx.xx.22"&gt;.x.xxx.xx.22&lt;/A&gt;&lt;/P&gt;&lt;P&gt;cd /a/b/c/csvfiles&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when i run the above code i am not getting the file into my local drive.&lt;/P&gt;&lt;P&gt;Any help will be appreciated.&lt;/P&gt;&lt;P&gt;Eshan&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2013 18:05:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unable-to-download-a-csv-file-from-WinSCP-ftp-server-to-local/m-p/166125#M32029</guid>
      <dc:creator>Eshan</dc:creator>
      <dc:date>2013-12-06T18:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to download a csv file from WinSCP ftp server to local drive</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-download-a-csv-file-from-WinSCP-ftp-server-to-local/m-p/166126#M32030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't give us much to go on (like, how doesn't it work?)&amp;nbsp; Steps to troubleshoot this:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;First, test the command line text in the command line by typing it by hand.&amp;nbsp; See if that gets your file.&amp;nbsp; If not, it's a WINSCP problem (either ftp.txt or something else is wrong).&lt;/LI&gt;&lt;LI&gt;Then, see what string is actually getting passed into %sysexec.&amp;nbsp; Instead of %sysexec'ing it, %let it to a macro variable, and %put that.&amp;nbsp; If that has errors, fix them.&lt;/LI&gt;&lt;LI&gt;Once it does not have errors, if the program still doesn't work, take the %put result and copy/paste it into CMD.&amp;nbsp; See if that works.&amp;nbsp; If not, see where it's different from your typed in code from the first step.&amp;nbsp; Consider the possibility of invisible characters (like 'A0'x ) causing trouble.&lt;/LI&gt;&lt;LI&gt;If it's the same code but it still doesn't work when %sysexec'ed but does work when pasted into CMD, then you may have some issues with %sysexec.&amp;nbsp; It's possible it's not permitted on your SAS server (it's often disabled).&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2013 20:15:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unable-to-download-a-csv-file-from-WinSCP-ftp-server-to-local/m-p/166126#M32030</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2013-12-06T20:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to download a csv file from WinSCP ftp server to local drive</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-download-a-csv-file-from-WinSCP-ftp-server-to-local/m-p/166127#M32031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Snoopy for your reply.&lt;/P&gt;&lt;P&gt;I just realized that i do not have winscp installed in my system. So, I think i can't&amp;nbsp; download the file from the ftp server. I think this could be the blocker.&lt;/P&gt;&lt;P&gt;The other thing is like you said i am trying to login to the sftp server from CMD in the following way.&lt;/P&gt;&lt;P&gt;sftp &lt;A href="mailto:username@ipaddress"&gt;username@ipaddress&lt;/A&gt;&lt;/P&gt;&lt;P&gt;it prompted me to enter the password and i entered the password&lt;/P&gt;&lt;P&gt;But it says Permission denied&amp;lt;publickey, keyboard-interactive&amp;gt; along with a popup mesaage which says "SSH error occured, please contact administrator".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;In my code, in the &lt;A href="ftp://ftp.txt/"&gt;ftp.txt&lt;/A&gt;, do i have to add the port(22) also to the server at the end.?&lt;/P&gt;&lt;P&gt;If you provide some clarification on my questions, it would really make me understand the whole process.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;Eshan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2013 21:39:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unable-to-download-a-csv-file-from-WinSCP-ftp-server-to-local/m-p/166127#M32031</guid>
      <dc:creator>Eshan</dc:creator>
      <dc:date>2013-12-06T21:39:51Z</dc:date>
    </item>
  </channel>
</rss>

