<?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: Copying External file from Linux SAS Server to Windows directory in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Copying-External-file-from-Linux-SAS-Server-to-Windows-directory/m-p/390136#M93561</link>
    <description>&lt;P&gt;Is SAS running on one of the involved servers? This would allow a simpler filename statement for either source or target.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When reading/writing text files, avoid the binary option, and use the complete absolute pathnames in the filename statements:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename src ftp
  "/linux path/test.txt"
  host='abc.com'
  user = 'sasdemo'
  pass= "abc123"
;

filename tgt ftp
  "windows path\test.txt"
  host='sasftp001'
  user='sasdemo'
  pass= "abc123"
;

data _null_;
infile src;
file tgt;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Post your log for steps that do not work.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Aug 2017 08:14:50 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-08-23T08:14:50Z</dc:date>
    <item>
      <title>Copying External file from Linux SAS Server to Windows directory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copying-External-file-from-Linux-SAS-Server-to-Windows-directory/m-p/390133#M93560</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to ask your help regarding on converting the ftp code in a .sh file below to a code that can run in SAS BASE?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#!/bin/bash&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WINDOWS_SERVER=sasftp001&lt;/P&gt;&lt;P&gt;USER=sasdemo&lt;/P&gt;&lt;P&gt;PASSWORD=abc123&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ftp -in &amp;lt;&amp;lt;EOF&lt;/P&gt;&lt;P&gt;open $WINDOWS_SERVER&lt;/P&gt;&lt;P&gt;user $USER $PASSWORD&lt;/P&gt;&lt;P&gt;ascii&lt;/P&gt;&lt;P&gt;lcd /sas/sasdata/data/myfolder&lt;/P&gt;&lt;P&gt;put test.txt&lt;/P&gt;&lt;P&gt;cd /WindowsFolder/App/Data&lt;/P&gt;&lt;P&gt;close&amp;nbsp;&lt;/P&gt;&lt;P&gt;EOF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code above is working fine. Can everybody help me translate this one to a sas code? I created an ftp code but its not working so i tried creating the above script. Below is my SAS code :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename src ftp 'linux path' host='abc.com.' binary dir&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;user = 'sasdemo' pass= "abc123";&lt;/P&gt;&lt;P&gt;filename tgt ftp 'windows path' host='sasftp001' binary dir user='sasdemo' &lt;SPAN&gt;pass= "abc123;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;infile src(test.txt) truncover;&lt;/P&gt;&lt;P&gt;input;&lt;/P&gt;&lt;P&gt;file target(test.text);&lt;/P&gt;&lt;P&gt;put _infile_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&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;Albert0&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>Wed, 23 Aug 2017 08:00:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copying-External-file-from-Linux-SAS-Server-to-Windows-directory/m-p/390133#M93560</guid>
      <dc:creator>Albert0</dc:creator>
      <dc:date>2017-08-23T08:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Copying External file from Linux SAS Server to Windows directory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copying-External-file-from-Linux-SAS-Server-to-Windows-directory/m-p/390136#M93561</link>
      <description>&lt;P&gt;Is SAS running on one of the involved servers? This would allow a simpler filename statement for either source or target.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When reading/writing text files, avoid the binary option, and use the complete absolute pathnames in the filename statements:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename src ftp
  "/linux path/test.txt"
  host='abc.com'
  user = 'sasdemo'
  pass= "abc123"
;

filename tgt ftp
  "windows path\test.txt"
  host='sasftp001'
  user='sasdemo'
  pass= "abc123"
;

data _null_;
infile src;
file tgt;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Post your log for steps that do not work.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 08:14:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copying-External-file-from-Linux-SAS-Server-to-Windows-directory/m-p/390136#M93561</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-08-23T08:14:50Z</dc:date>
    </item>
  </channel>
</rss>

