<?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 Need to copy file from windows to unix server in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595039#M171106</link>
    <description>&lt;P&gt;Guys , I need to copy file from windows shared network to the unix path , sas running on unix environment,&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;can any one help me with the right syntax we can use for it??&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2019 12:59:11 GMT</pubDate>
    <dc:creator>arunrami</dc:creator>
    <dc:date>2019-10-09T12:59:11Z</dc:date>
    <item>
      <title>Need to copy file from windows to unix server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595039#M171106</link>
      <description>&lt;P&gt;Guys , I need to copy file from windows shared network to the unix path , sas running on unix environment,&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;can any one help me with the right syntax we can use for it??&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 12:59:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595039#M171106</guid>
      <dc:creator>arunrami</dc:creator>
      <dc:date>2019-10-09T12:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy file from windows to unix server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595042#M171107</link>
      <description>&lt;P&gt;Is your windows server mapped/mounted to the Unix server?&amp;nbsp; Or are you running software like Samba to make the Windows server visible to Unix?&amp;nbsp; If not, Unix will not be able to "see" the windows server.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 13:15:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595042#M171107</guid>
      <dc:creator>JasonDiVirgilio</dc:creator>
      <dc:date>2019-10-09T13:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy file from windows to unix server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595047#M171109</link>
      <description>&lt;P&gt;If you want to run the copy action from a SAS session running on a UNIX server, you need to save the file in Windows to a location that your SAS server can "see", or you need to use a file copy utility (or filename ftp/sftp), and have a FTP/SFTP server program running on the Windows side.&lt;/P&gt;
&lt;P&gt;Depending on what you have (and if you can run external commands from your SAS session), we can determine which method to use.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 13:31:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595047#M171109</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-09T13:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy file from windows to unix server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595051#M171110</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp; .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you please share the document or link where I can find the FTP sytanx for SAS&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 13:40:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595051#M171110</guid>
      <dc:creator>arunrami</dc:creator>
      <dc:date>2019-10-09T13:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy file from windows to unix server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595053#M171111</link>
      <description>&lt;P&gt;Look in the SAS documentation, section Global Statements:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsglobal&amp;amp;docsetTarget=p0v0ijxl1k6d4bn16cshtic7u4i3.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsglobal&amp;amp;docsetTarget=p0v0ijxl1k6d4bn16cshtic7u4i3.htm&amp;amp;locale=en&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FILENAME SFTP is just two items down in the navigation pane.&lt;/P&gt;
&lt;P&gt;Once you have defined a file reference to the FTP source, you can use it as infile in a data step or as datafile in a proc import.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 13:44:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595053#M171111</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-09T13:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy file from windows to unix server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595060#M171112</link>
      <description>&lt;P&gt;I have refered one of your previous answer for my problem .&lt;/P&gt;&lt;P&gt;Code is running fine but it is not actually performing the expected operation,. can you please help where i went wrong&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let filename=Arun.csv;
%let username=%sysget(USER);

filename oscmd pipe "sftp &amp;amp;username. windowspath/&amp;amp;filename @unixpath/&amp;amp;filename..dat 2&amp;gt;&amp;amp;1";

data _null_;
infile oscmd;
input;
put _infile_;
run;

filename oscmd clear;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Oct 2019 14:13:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595060#M171112</guid>
      <dc:creator>arunrami</dc:creator>
      <dc:date>2019-10-09T14:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy file from windows to unix server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595067#M171117</link>
      <description>&lt;P&gt;What does the log tell us?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 14:37:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595067#M171117</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-09T14:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy file from windows to unix server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595091#M171130</link>
      <description>&lt;P&gt;I don't see the SFTP hostname in your code.&amp;nbsp; You might need &amp;amp;username@&amp;amp;hostname .&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 15:01:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595091#M171130</guid>
      <dc:creator>JasonDiVirgilio</dc:creator>
      <dc:date>2019-10-09T15:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy file from windows to unix server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595094#M171132</link>
      <description>&lt;P&gt;NOTE: Compression was disabled for data set WORK.NULL because compression&lt;BR /&gt;overhead would increase the size of the data set.&lt;BR /&gt;NOTE: The infile OSCMD is:&lt;BR /&gt;&lt;BR /&gt;Pipe command="sftp&lt;BR /&gt;N****@\\*****/Arun.csv &amp;lt;&amp;lt;&amp;lt; $'put&lt;BR /&gt;**********/Arun.csv' 2&amp;gt;&amp;amp;1"&lt;/P&gt;&lt;P&gt;/bin/ksh: syntax error at line 1 : `&amp;lt;' unexpected&lt;BR /&gt;NOTE: 1 record was read from the infile OSCMD.&lt;BR /&gt;The minimum record length was 49.&lt;BR /&gt;The maximum record length was 49.&lt;BR /&gt;NOTE: The data set WORK.NULL has 1 observations and 1 variables.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 15:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595094#M171132</guid>
      <dc:creator>arunrami</dc:creator>
      <dc:date>2019-10-09T15:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy file from windows to unix server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595095#M171133</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/200330"&gt;@arunrami&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;NOTE: Compression was disabled for data set WORK.NULL because compression&lt;BR /&gt;overhead would increase the size of the data set.&lt;BR /&gt;NOTE: The infile OSCMD is:&lt;BR /&gt;&lt;BR /&gt;Pipe command="sftp&lt;BR /&gt;N****@\\*****/Arun.csv &amp;lt;&amp;lt;&amp;lt; $'put&lt;BR /&gt;**********/Arun.csv' 2&amp;gt;&amp;amp;1"&lt;/P&gt;
&lt;P&gt;/bin/ksh: syntax error at line 1 : `&amp;lt;' unexpected&lt;BR /&gt;NOTE: 1 record was read from the infile OSCMD.&lt;BR /&gt;The minimum record length was 49.&lt;BR /&gt;The maximum record length was 49.&lt;BR /&gt;NOTE: The data set WORK.NULL has 1 observations and 1 variables.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This cannot be the log of may code, as I do not use any INPUT redirection (&amp;lt;), I only redirect stderr to stdout.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 15:06:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595095#M171133</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-09T15:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy file from windows to unix server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595116#M171145</link>
      <description>&lt;P&gt;Please find this , exactly used your syntax.&lt;/P&gt;&lt;P&gt;intention : need to copy csv file from windows to unix&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Compression was disabled for data set WORK.NULL because compression 
      overhead would increase the size of the data set.
NOTE: The infile OSCMD is:
      
      Pipe command="sftp N**** 
      \\****/Arun.csv
      @/******/Arun.csv 2&amp;gt;&amp;amp;1"

usage: sftp [-1246aCfpqrv] [-B buffer_size] [-b batchfile] [-c cipher]
          [-D sftp_server_path] [-F ssh_config] [-i identity_file] [-l limit]
          [-o ssh_option] [-P port] [-R num_requests] [-S program]
          [-s subsystem | sftp_server] host
       sftp [user@]host[:file ...]
       sftp [user@]host[:dir[/]]
       sftp -b batchfile [user@]host&lt;BR /&gt;NOTE: 7 records were read from the infile OSCMD.&lt;BR /&gt;The minimum record length was 32.&lt;BR /&gt;The maximum record length was 77.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Oct 2019 15:46:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595116#M171145</guid>
      <dc:creator>arunrami</dc:creator>
      <dc:date>2019-10-09T15:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy file from windows to unix server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595118#M171146</link>
      <description>&lt;P&gt;Make sure you can get the command to run from the command prompt without using SAS at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The SFTP command is telling you that the syntax of your command is wrong.&amp;nbsp; It wants these three pieces of information.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; sftp [user@]host[:file ...]&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So I would assume that would look like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;sftp myuser@myhost:\\servername\sharename\dirname\filename.ext&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note there is no place to put a password so you either need to have previously shared keys with the host, or use the -i option to specify the file with the user credentials that will let you connect to the host.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 15:57:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595118#M171146</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-09T15:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy file from windows to unix server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595120#M171148</link>
      <description>&lt;P&gt;Please post the link of my post where you got the sftp code from. (It's hard for me to find that particular post, as I have dealt with sftp transfers quite often here on the ciommunities)&lt;/P&gt;
&lt;P&gt;It may be that the post needs correction.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 16:03:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595120#M171148</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-09T16:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy file from windows to unix server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595121#M171149</link>
      <description>&lt;A href="https://communities.sas.com/t5/General-SAS-Programming/Moving-files-from-UNIX-to-Windows-network-location-using-SAS-EG/td-p/323748" target="_blank"&gt;https://communities.sas.com/t5/General-SAS-Programming/Moving-files-from-UNIX-to-Windows-network-location-using-SAS-EG/td-p/323748&lt;/A&gt;</description>
      <pubDate>Wed, 09 Oct 2019 16:04:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595121#M171149</guid>
      <dc:creator>arunrami</dc:creator>
      <dc:date>2019-10-09T16:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy file from windows to unix server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595125#M171153</link>
      <description>&lt;P&gt;That example was for copying a file &lt;U&gt;from&lt;/U&gt; the SAS server &lt;U&gt;to&lt;/U&gt; a remote destination. It is not intended for retrieving a dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The filename statement for retrieving a file needs to be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename oscmd pipe "sftp &amp;amp;user.@&amp;amp;host.:&amp;amp;external_path./extfilename. &amp;amp;local_path./&amp;amp;locfilename. 2&amp;gt;&amp;amp;1";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that passwordless authentication needs to be set up beforehand. SSH does not support passwords on the commandline, for security reasons.&lt;/P&gt;
&lt;P&gt;To make development of the external command easier, I suggest you log ion to your SAS server with SSH yourself and test the command on the commandline till it works there. Note that I work on AIX, and sftp syntax on Linux might be slightly different.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 16:13:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595125#M171153</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-09T16:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy file from windows to unix server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595377#M171259</link>
      <description>I have used the same syntax as yours and I too using SAS/AIX only. . still file not getting copied from external windows path to unix .. here is the log&lt;BR /&gt;&lt;BR /&gt;NOTE: Compression was disabled for data set WORK.NULL because compression&lt;BR /&gt;overhead would increase the size of the data set.&lt;BR /&gt;NOTE: The infile OSCMD is:&lt;BR /&gt;&lt;BR /&gt;Pipe command="sftp&lt;BR /&gt;N******@winp-001:\\Arun.csv /localpath/arun.csv 2&amp;gt;&amp;amp;1"&lt;BR /&gt;&lt;BR /&gt;usage: sftp [-1246aCfpqrv] [-B buffer_size] [-b batchfile] [-c cipher]&lt;BR /&gt;[-D sftp_server_path] [-F ssh_config] [-i identity_file] [-l limit]&lt;BR /&gt;[-o ssh_option] [-P port] [-R num_requests] [-S program]&lt;BR /&gt;[-s subsystem | sftp_server] host&lt;BR /&gt;sftp [user@]host[:file ...]&lt;BR /&gt;sftp [user@]host[:dir[/]]&lt;BR /&gt;sftp -b batchfile [user@]host&lt;BR /&gt;NOTE: 7 records were read from the infile OSCMD.&lt;BR /&gt;The minimum record length was 32.&lt;BR /&gt;The maximum record length was 77.&lt;BR /&gt;NOTE: The data set WORK.NULL has 7 observations and 0 variables.&lt;BR /&gt;N</description>
      <pubDate>Thu, 10 Oct 2019 13:21:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595377#M171259</guid>
      <dc:creator>arunrami</dc:creator>
      <dc:date>2019-10-10T13:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy file from windows to unix server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595384#M171263</link>
      <description>&lt;P&gt;Do not use backslashes on UNIX commandlines. A backslash has a very special meaning for UNIX shells and must not be used for anything else.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I repeat: log on to the UNIX server and run the sftp from the commandline until it works. Then start using it in SAS code.&lt;/P&gt;
&lt;P&gt;Start with logging on in interactive mode by simply doing&lt;/P&gt;
&lt;PRE&gt;sftp user@servername&lt;/PRE&gt;
&lt;P&gt;Then retrieve a file with the subcommand get (you can use most of the FTP subcommands in sftp). From that you should be able to create the commandline non-interactive version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Disclaimer: I retrieve my data from a sane operating system (Linux), not from any Windows, so I have no idea how filenames need to be formulated so that the &lt;STRONG&gt;D&lt;/STRONG&gt;umb &lt;STRONG&gt;O&lt;/STRONG&gt;perating &lt;STRONG&gt;S&lt;/STRONG&gt;ystem understands it.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 13:31:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-copy-file-from-windows-to-unix-server/m-p/595384#M171263</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-10T13:31:14Z</dc:date>
    </item>
  </channel>
</rss>

