<?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: FTP transfer  issues -corrupt files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/332817#M271963</link>
    <description>&lt;P&gt;Ok-thanks.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lawrence&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Feb 2017 22:12:33 GMT</pubDate>
    <dc:creator>LB</dc:creator>
    <dc:date>2017-02-14T22:12:33Z</dc:date>
    <item>
      <title>FTP transfer  issues -corrupt files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/331680#M271952</link>
      <description>&lt;P&gt;So I have a FTP script that takes a file from my home folder on one linux server to &amp;nbsp;another.&lt;/P&gt;
&lt;P&gt;This file is used as a credential file for SAMBA. This will be used as part of a larger program for other developers to shortcut having to manually ftp &amp;nbsp;this file to different servers.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When the file transfers through FTP it gets corrupted. &amp;nbsp;This is verified by manually downloading the file and reloading it through a FTP client (reflections FTP)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the second time this has happened in that the same thing happened to excel files even when the binary option is used.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyone know why this might occur- &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the script-It works just fine in terms of moving the data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filename linhome "P:\cs.txt";&lt;BR /&gt;filename srvrdest ftp "/home/&amp;amp;sysuserid/cs.txt" &lt;BR /&gt; user=&amp;amp;sysuserid host="&amp;amp;serv" cd="/home/&amp;amp;sysuserid" pass="&amp;amp;RITOPASS" binary debug;&lt;BR /&gt;data _null_;&lt;BR /&gt; infile linhome;&lt;BR /&gt; file srvrdest;&lt;BR /&gt; input;&lt;BR /&gt; put _infile_;&lt;BR /&gt; run;&lt;BR /&gt;filename linhome clear;&lt;BR /&gt;filename srvrdest clear;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 20:51:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/331680#M271952</guid>
      <dc:creator>LB</dc:creator>
      <dc:date>2017-02-10T20:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: FTP transfer  issues -corrupt files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/331683#M271953</link>
      <description>&lt;P&gt;If I run this-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;filename COPY PIPE "scp /home/bxxx/cs.txt bxxx@xxxx8x.ox.kx.org:/home/bxxx/cs.txt";&lt;BR /&gt;data _null_ ;&lt;BR /&gt;infile COPY;&lt;BR /&gt;input ;&lt;BR /&gt;put _infile_;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get this error-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;(gnome-ssh-askpass:72206): Gtk-WARNING **: cannot open display: localhost:10.0&lt;BR /&gt;Host key verification failed.&lt;BR /&gt;lost connection&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 20:57:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/331683#M271953</guid>
      <dc:creator>LB</dc:creator>
      <dc:date>2017-02-10T20:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: FTP transfer  issues -corrupt files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/331697#M271954</link>
      <description>&lt;P&gt;scp will ask for credentials if you do not have public/private key authentication enabled. Trying to prompt for a password probably causes your error.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10675"&gt;@LB&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;If I run this-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;filename COPY PIPE "scp /home/bxxx/cs.txt bxxx@xxxx8x.ox.kx.org:/home/bxxx/cs.txt";&lt;BR /&gt;data _null_ ;&lt;BR /&gt;infile COPY;&lt;BR /&gt;input ;&lt;BR /&gt;put _infile_;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get this error-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;(gnome-ssh-askpass:72206): Gtk-WARNING **: cannot open display: localhost:10.0&lt;BR /&gt;Host key verification failed.&lt;BR /&gt;lost connection&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 21:04:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/331697#M271954</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-02-10T21:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: FTP transfer  issues -corrupt files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/331701#M271955</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10675"&gt;@LB&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;So I have a FTP script that takes a file from my home folder on one linux server to &amp;nbsp;another.&lt;/P&gt;
&lt;P&gt;This file is used as a credential file for SAMBA. This will be used as part of a larger program for other developers to shortcut having to manually ftp &amp;nbsp;this file to different servers.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When the file transfers through FTP it gets corrupted. &amp;nbsp;This is verified by manually downloading the file and reloading it through a FTP client (reflections FTP)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the second time this has happened in that the same thing happened to excel files even when the binary option is used.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyone know why this might occur- &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the script-It works just fine in terms of moving the data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filename linhome "P:\cs.txt";&lt;BR /&gt;filename srvrdest ftp "/home/&amp;amp;sysuserid/cs.txt" &lt;BR /&gt; user=&amp;amp;sysuserid host="&amp;amp;serv" cd="/home/&amp;amp;sysuserid" pass="&amp;amp;RITOPASS" binary debug;&lt;BR /&gt;data _null_;&lt;BR /&gt; infile linhome;&lt;BR /&gt; file srvrdest;&lt;BR /&gt; input;&lt;BR /&gt; put _infile_;&lt;BR /&gt; run;&lt;BR /&gt;filename linhome clear;&lt;BR /&gt;filename srvrdest clear;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Could it be that the binary option prevents conversion of CRLF to LF?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 21:07:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/331701#M271955</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-02-10T21:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: FTP transfer  issues -corrupt files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/332343#M271956</link>
      <description>&lt;P&gt;That I don't know.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But FTP is still being problematic-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying scp w/o much success.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lawrence&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 21:02:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/332343#M271956</guid>
      <dc:creator>LB</dc:creator>
      <dc:date>2017-02-13T21:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: FTP transfer  issues -corrupt files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/332353#M271957</link>
      <description>&lt;P&gt;Is there is a SCP solution-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried different variants here-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;filename COPY PIPE "scp file='/home/b335489/cs.txt' todir='xxx9@xxx.xx.x.org:/home/b335489/'" ;&lt;BR /&gt;data _null_ ;&lt;BR /&gt;infile COPY;&lt;BR /&gt;input ;&lt;BR /&gt;put _infile_;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;AND&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;filename COPY PIPE "scp file='/home/b335489/cs.txt' todir='&lt;/SPAN&gt;&lt;SPAN&gt;xx&lt;/SPAN&gt;&lt;SPAN&gt;: password@x&lt;/SPAN&gt;&lt;SPAN&gt;xx&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;xx&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;x&lt;/SPAN&gt;&lt;SPAN&gt;.org:/home/b335489/'" ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The first fails do to authentication and the second fails as it cannot resolve the host. &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 22:00:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/332353#M271957</guid>
      <dc:creator>LB</dc:creator>
      <dc:date>2017-02-13T22:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: FTP transfer  issues -corrupt files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/332398#M271958</link>
      <description>&lt;P&gt;When using SSH (the protocol used by scp) you need to set up public/private key authentication to prevent being prompted for passwords. Once the scp command works from a commandline, you can start using it from SAS.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 22:58:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/332398#M271958</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-02-13T22:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: FTP transfer  issues -corrupt files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/332405#M271959</link>
      <description>&lt;P&gt;IS there a way to actually input the password or do I need to set up the SSH keys?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is being set up in a macro so that the user inserts their password in a macro that is carried through-It is run once to copy a file-all to use SAMBA. I would just FTP the file-but it, like my excel files gets corrupted in transit.&lt;/P&gt;
&lt;P&gt;I don't think setting up the public private keys will work in this case.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lawrence&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 23:13:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/332405#M271959</guid>
      <dc:creator>LB</dc:creator>
      <dc:date>2017-02-13T23:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: FTP transfer  issues -corrupt files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/332420#M271960</link>
      <description>&lt;P&gt;Software with a respect for security will NOT let you supply passwords on the commandline or other means that can be sniffed (a simple ps -ef would reveal the password). So set up public/private keys for SSH.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And could you please show an example how a file is corrupted by FTP?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 23:20:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/332420#M271960</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-02-13T23:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: FTP transfer  issues -corrupt files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/332425#M271961</link>
      <description>&lt;P&gt;Good to know- It makes sense to avoid what could be an inherent error on a users part- &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the excel files-it just gives an error that the file is corrupted and cannot be opened. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;can't replicate it per se as it takes too much time&amp;nbsp;to do so.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the text file is different-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a simple script that outputs a file on the local unix home folder with the credentials for SAMBA&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;file "/home/&amp;amp;sysuserid/cs.txt";&lt;/P&gt;
&lt;P&gt;put "username = &amp;amp;SYSUSERID";&lt;BR /&gt;put "password = &amp;amp;WINPASS"; &lt;BR /&gt;put "domain = CS";&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The FTP script that does work ports it to the other server-when I&amp;nbsp;download &amp;nbsp;the file it looks the same-however something happens in transit. If I run the program through the management console as a batch job on the first server-the SAMBA credential file works.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However when I attempt to use it on the second server with the same process it fails.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know the FTP is the issue as if I copy the file down through a FTP client and then reload it into the second, the&amp;nbsp;&lt;SPAN&gt;SAMBA credential file now works. &amp;nbsp;It is an ascii file so I really don't understand the issue.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks for your help. &amp;nbsp;I know SAS well but not Unix/linux. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Lawrence&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 23:46:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/332425#M271961</guid>
      <dc:creator>LB</dc:creator>
      <dc:date>2017-02-13T23:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: FTP transfer  issues -corrupt files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/332476#M271962</link>
      <description>&lt;P&gt;More advanced text editors (ie notepad++) will tell you the text file format (DOS or UNIX) in the status line.&lt;/P&gt;
&lt;P&gt;Or allow you to view the file in hexadecimal mode, so you can find differences that are not visible otherwise.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 05:25:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/332476#M271962</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-02-14T05:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: FTP transfer  issues -corrupt files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/332817#M271963</link>
      <description>&lt;P&gt;Ok-thanks.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lawrence&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 22:12:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FTP-transfer-issues-corrupt-files/m-p/332817#M271963</guid>
      <dc:creator>LB</dc:creator>
      <dc:date>2017-02-14T22:12:33Z</dc:date>
    </item>
  </channel>
</rss>

