<?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: How to trnsfer file from Windows to Unix in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200844#M37539</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will probably recheck everything and let you know the result. Thank you and going to check the steps even suggested by RW9.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Apr 2015 14:03:52 GMT</pubDate>
    <dc:creator>Vish33</dc:creator>
    <dc:date>2015-04-21T14:03:52Z</dc:date>
    <item>
      <title>How to trnsfer file from Windows to Unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200837#M37532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried to create a program to trasfer files from my local directory (windows) to SAS (Unix) server. BUt i am unable to get the file, and i am getting note in log file saying that connection timed out . Please give any sugestions on this. Below is the code i have written.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let ftpcmds= C:\WINDOWS\system32\cmd.exe;&lt;BR /&gt;%let host=&amp;amp;host;&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; &lt;BR /&gt;%let userid=&amp;amp;userid;&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; &lt;BR /&gt;%let &lt;A href="mailto:ftppwd=lbg@307138"&gt;ftppwd=&amp;amp;ftppwd&lt;/A&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; &lt;BR /&gt;%let xfermode=binary;&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; &lt;BR /&gt;%let homedir= &amp;amp;source ;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;%let filename=&amp;amp;filename;&lt;BR /&gt;%let cmd=mput;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;%let thefile=&amp;amp;target;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%Macro ftp ; &lt;/P&gt;&lt;P&gt;filename ftpcmds "&amp;amp;ftpcmds"; &lt;BR /&gt;data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; file ftpcmds pad lrecl=80;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; put "user &amp;amp;userid &amp;amp;ftppwd";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; put "&amp;amp;xfermode";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; %if %eval(&amp;amp;homedir) %then %do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "cd &amp;amp;homedir"; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "bin";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "prompt";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "lcd &amp;amp;thefile";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "&amp;amp;cmd &amp;amp;filename ";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; %end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; %else %do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "File Doesn't exist";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; %end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;filename doftp pipe "ftp -n &amp;amp;host &amp;lt; &amp;amp;ftpcmds";&lt;BR /&gt;data _null_;&lt;BR /&gt;infile doftp;&lt;BR /&gt;input;&lt;BR /&gt;put _infile_;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%ftp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 11:44:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200837#M37532</guid>
      <dc:creator>Vish33</dc:creator>
      <dc:date>2015-04-21T11:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to trnsfer file from Windows to Unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200838#M37533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And what are the results of running through normal debugging techniques?&amp;nbsp; I.e.&lt;/P&gt;&lt;P&gt;1) put the ftp plus commands into the windows command window and run them, does it work there?&lt;/P&gt;&lt;P&gt;2) If so, then write the same commands into a datastep and execute in SAS, does it work there.&lt;/P&gt;&lt;P&gt;3) If it does work there, add in the macro code and use the options mlogic mprint symblogen, to see exactly what commands are being sent out, do these match?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you run through these steps you will see where it falls over and what is missing, maybe some permissions perhaps either in Win or Unix or SAS.&lt;/P&gt;&lt;P&gt;But to isolate something you need to start small and work up to creating a macro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 12:01:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200838#M37533</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-04-21T12:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to trnsfer file from Windows to Unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200839#M37534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see quite some issues here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ftpcmds points to the windows command interpreter, and not to a writable file. If the write actually worked, you borked your system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if %eval(&amp;amp;homedir) %then %do;&lt;/P&gt;&lt;P&gt;&amp;amp;homedir is a directory name, which cannot reasonably be evaluated by the %eval function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where is your SAS session running? If you have a UNIX SAS server, then the external commands will run on the UNIX platform, no "C:\" etc there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 12:14:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200839#M37534</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-04-21T12:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to trnsfer file from Windows to Unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200840#M37535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAS session is running on Unix server . and i want to transfer the file existing in my local drive to Unix server. Is there anyway to transfer these files through code..i know that directly i cant use C:\ drive in SAS environment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 12:32:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200840#M37535</guid>
      <dc:creator>Vish33</dc:creator>
      <dc:date>2015-04-21T12:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to trnsfer file from Windows to Unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200841#M37536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is the note i am getting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ftp: connect: A remote host refused an attempted connect operation.&lt;/P&gt;&lt;P&gt;Not connected.&lt;/P&gt;&lt;P&gt;Not connected.&lt;/P&gt;&lt;P&gt;Not connected.&lt;/P&gt;&lt;P&gt;Not connected.&lt;/P&gt;&lt;P&gt;Interactive mode off.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 12:55:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200841#M37536</guid>
      <dc:creator>Vish33</dc:creator>
      <dc:date>2015-04-21T12:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to trnsfer file from Windows to Unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200842#M37537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First thing: when specifying files to store scripts, you must adhere to the UNIX file system syntax (&lt;A href="http://en.wikipedia.org/wiki/Unix_filesystem" title="http://en.wikipedia.org/wiki/Unix_filesystem"&gt;Unix filesystem - Wikipedia, the free encyclopedia&lt;/A&gt;) and make sure that the path points to a location where you have write permission.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;Second: to initiate a file transfer between the two platforms from the UNIX side, you need a communications partner waiting for you on the Windows side. If you don't have Microsoft IIS running on Windows, you will need third-party software for this (&lt;A href="http://en.wikipedia.org/wiki/List_of_FTP_server_software" title="http://en.wikipedia.org/wiki/List_of_FTP_server_software"&gt;List of FTP server software - Wikipedia, the free encyclopedia&lt;/A&gt;). It is one of the gross shortcomings of Windows that it does not include such essential services out of the box.&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Third: when initiating from the UNIX side, you need to GET the files in order to transfer from Windows to UNIX.&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Depending on your needs, you may be better off by establishing a shared network location with a samba server on the UNIX side, or use the samba client on UNIX to connect to a Windows share, or use some other means supplied by your IT people.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 13:09:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200842#M37537</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-04-21T13:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to trnsfer file from Windows to Unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200843#M37538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The first line signals that you supplied a nonexistent hostname, everything else is a consequence of that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 13:13:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200843#M37538</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-04-21T13:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to trnsfer file from Windows to Unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200844#M37539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will probably recheck everything and let you know the result. Thank you and going to check the steps even suggested by RW9.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 14:03:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200844#M37539</guid>
      <dc:creator>Vish33</dc:creator>
      <dc:date>2015-04-21T14:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to trnsfer file from Windows to Unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200845#M37540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure .&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;filename doftp pipe "ftp -n &amp;amp;host &amp;lt; &amp;amp;ftpcmds";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Why you refer &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;amp;ftpcmds&amp;nbsp; to cmd.exe ? Shouldn't&amp;nbsp; that be a file(contains shell code)&amp;nbsp; name ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2015 13:25:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-trnsfer-file-from-Windows-to-Unix/m-p/200845#M37540</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-04-22T13:25:10Z</dc:date>
    </item>
  </channel>
</rss>

