<?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: Error with getting a file from ftp site in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-with-getting-a-file-from-ftp-site/m-p/399042#M96598</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/167021"&gt;@Lynn_SAS&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you! The problem solved by adding the passvie option in filename ftp.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;To further elaborate, how standard FTP works:&lt;/P&gt;
&lt;P&gt;The client opens a connection to the server and logs in. As soon as you start a download, your client opens a port on the local computer, sends the port number to the server, and starts to listen on that port. The server now becomes "active", and tries to open a connection to your client on that port for the file transfer; basically, for this operation your client becomes a server.&lt;/P&gt;
&lt;P&gt;Since firewalls block open ports against the outside world, this fails. When the passive option is used, all connections are made with the FTP server being the listener ("passive") and your client opening the connection to that.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Sep 2017 06:25:25 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-09-27T06:25:25Z</dc:date>
    <item>
      <title>Error with getting a file from ftp site</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-with-getting-a-file-from-ftp-site/m-p/398220#M96291</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem with retriving a file from ftp site. From the details in log, I'm able to connect to the site and get to the target folder. However it failed to establish the connection to the file that I'd like to download. Could anyone have any ideas about this issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename inv ftp 'inventory.csv'&lt;BR /&gt;host = 'xxxxxxxx'&lt;BR /&gt;user = 'xxxxxxx'&lt;BR /&gt;pass = 'xxxxxxxx'&lt;BR /&gt;port = ###&lt;BR /&gt;/*wait_milliseconds=1000000*/&lt;BR /&gt;cd = '/Download/'&lt;BR /&gt;recfm=s&lt;/P&gt;&lt;P&gt;debug;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename lcl 'C:\Users\Downloads\inv.csv' recfm = n;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt;N=1;&lt;BR /&gt;infile inv NBYTE=N;&lt;BR /&gt;input;&lt;BR /&gt;file lcl;&lt;BR /&gt;put _infile_ @@;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The log is:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NOTE: 220 (vsFTPd 3.0.2)&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 220 (vsFTPd 3.0.2)&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; USER&amp;nbsp;xxxxxx&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 331 Please specify the password.&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; PASS XXXXXXXXXX&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 230 Login successful.&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; OPTS UTF8 ON&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 200 Always in UTF8 mode.&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; OPTS UTF8 NLST&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 501 Option not understood.&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; OPTS UTF-8 NLST&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 501 Option not understood.&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; PORT 10,16,20,27,237,200&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 200 PORT command successful. Consider using PASV.&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; TYPE I&lt;BR /&gt;2 The SAS System 16:03 Friday, September 22, 2017&lt;/P&gt;&lt;P&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 200 Switching to Binary mode.&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; CWD /Download/&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 250 Directory successfully changed.&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; PWD&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 257 "/Download"&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; RETR inventory.csv&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 425 Failed to establish connection.&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR: Invalid Reply received for the RETR command..&lt;/FONT&gt;&lt;BR /&gt;NOTE: UNBUFFERED is the default with RECFM=N.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 20:46:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-with-getting-a-file-from-ftp-site/m-p/398220#M96291</guid>
      <dc:creator>Lynn_SAS</dc:creator>
      <dc:date>2017-09-22T20:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Error with getting a file from ftp site</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-with-getting-a-file-from-ftp-site/m-p/398249#M96308</link>
      <description>&lt;P&gt;If you try to retrieve this file using the FTP command at a Windows command line then manually typing your instructions does it work OK?&lt;/P&gt;</description>
      <pubDate>Sat, 23 Sep 2017 01:13:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-with-getting-a-file-from-ftp-site/m-p/398249#M96308</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-09-23T01:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: Error with getting a file from ftp site</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-with-getting-a-file-from-ftp-site/m-p/398273#M96319</link>
      <description>&lt;P&gt;Try to use the PASSIVE option in filename ftp. This option was introduced with 9.3.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Sep 2017 07:42:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-with-getting-a-file-from-ftp-site/m-p/398273#M96319</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-09-23T07:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: Error with getting a file from ftp site</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-with-getting-a-file-from-ftp-site/m-p/398945#M96565</link>
      <description>&lt;P&gt;I have difficulties to login the ftp site using command line. However, I can easily open the ftp site and download the file from it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 20:59:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-with-getting-a-file-from-ftp-site/m-p/398945#M96565</guid>
      <dc:creator>Lynn_SAS</dc:creator>
      <dc:date>2017-09-26T20:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error with getting a file from ftp site</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-with-getting-a-file-from-ftp-site/m-p/398949#M96568</link>
      <description>&lt;P&gt;Thank you! The problem solved by adding the passvie option in filename ftp.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 21:09:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-with-getting-a-file-from-ftp-site/m-p/398949#M96568</guid>
      <dc:creator>Lynn_SAS</dc:creator>
      <dc:date>2017-09-26T21:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Error with getting a file from ftp site</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-with-getting-a-file-from-ftp-site/m-p/399042#M96598</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/167021"&gt;@Lynn_SAS&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you! The problem solved by adding the passvie option in filename ftp.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;To further elaborate, how standard FTP works:&lt;/P&gt;
&lt;P&gt;The client opens a connection to the server and logs in. As soon as you start a download, your client opens a port on the local computer, sends the port number to the server, and starts to listen on that port. The server now becomes "active", and tries to open a connection to your client on that port for the file transfer; basically, for this operation your client becomes a server.&lt;/P&gt;
&lt;P&gt;Since firewalls block open ports against the outside world, this fails. When the passive option is used, all connections are made with the FTP server being the listener ("passive") and your client opening the connection to that.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 06:25:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-with-getting-a-file-from-ftp-site/m-p/399042#M96598</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-09-27T06:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Error with getting a file from ftp site</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-with-getting-a-file-from-ftp-site/m-p/400319#M97050</link>
      <description>&lt;P&gt;Thank you again for the further explaination!&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2017 16:00:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-with-getting-a-file-from-ftp-site/m-p/400319#M97050</guid>
      <dc:creator>Lynn_SAS</dc:creator>
      <dc:date>2017-10-02T16:00:29Z</dc:date>
    </item>
  </channel>
</rss>

