<?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 Deleting file on SFTP server in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Deleting-file-on-SFTP-server/m-p/250589#M47256</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been trying to delete a text file on a SFTP server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried the following syntax:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;filename&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; SFTP &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;SFTP&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="2"&gt;'/'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;DIR&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;FILEEXT&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;LSA&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;HOST&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'***.**.***.**'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;USER&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'**********'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;WAIT_MILLISECONDS&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; = &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;5000&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;LRECL&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; = &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2000&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;OPTIONS&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'-P **&amp;nbsp;-i \\*****.*** -pw "*******"'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;DEBUG&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; rc = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(fdelete(SFTP));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;rc;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The macro variable RC returns the value 10011:&lt;/P&gt;&lt;P&gt;_SENODEL&amp;nbsp;&amp;nbsp;&amp;nbsp;10011&amp;nbsp;&amp;nbsp; Records cannot be deleted from this file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if I use an alternative program (E.g. WINSCP) to delete files on the SFTP server I dont recieve an error. So I dont think it has anything to do with autorisations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alot of the proposed solutions on the internet use RCMD = "dele *******.txt", but RCMD is not a valid extension on the filename SFTP syntax so that wont work either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using SAS 9.4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have an idea how to solve the problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Frederik&lt;/P&gt;</description>
    <pubDate>Wed, 17 Feb 2016 12:13:54 GMT</pubDate>
    <dc:creator>Frede_1</dc:creator>
    <dc:date>2016-02-17T12:13:54Z</dc:date>
    <item>
      <title>Deleting file on SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-file-on-SFTP-server/m-p/250589#M47256</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been trying to delete a text file on a SFTP server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried the following syntax:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;filename&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; SFTP &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;SFTP&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="2"&gt;'/'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;DIR&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;FILEEXT&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;LSA&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;HOST&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'***.**.***.**'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;USER&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'**********'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;WAIT_MILLISECONDS&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; = &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;5000&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;LRECL&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; = &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2000&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;OPTIONS&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'-P **&amp;nbsp;-i \\*****.*** -pw "*******"'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;DEBUG&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; rc = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(fdelete(SFTP));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;rc;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The macro variable RC returns the value 10011:&lt;/P&gt;&lt;P&gt;_SENODEL&amp;nbsp;&amp;nbsp;&amp;nbsp;10011&amp;nbsp;&amp;nbsp; Records cannot be deleted from this file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if I use an alternative program (E.g. WINSCP) to delete files on the SFTP server I dont recieve an error. So I dont think it has anything to do with autorisations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alot of the proposed solutions on the internet use RCMD = "dele *******.txt", but RCMD is not a valid extension on the filename SFTP syntax so that wont work either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using SAS 9.4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have an idea how to solve the problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Frederik&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 12:13:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-file-on-SFTP-server/m-p/250589#M47256</guid>
      <dc:creator>Frede_1</dc:creator>
      <dc:date>2016-02-17T12:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting file on SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-file-on-SFTP-server/m-p/250595#M47259</link>
      <description>&lt;P&gt;What this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename SFTP SFTP '/'
DIR FILEEXT LSA
HOST = '***.**.***.**'
USER = '**********'
WAIT_MILLISECONDS = 5000
LRECL = 2000
OPTIONS = '-P ** -i \\*****.*** -pw "*******"'
DEBUG
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;does is:&lt;/P&gt;
&lt;P&gt;- open a sftp connection to the server&lt;/P&gt;
&lt;P&gt;- retrieve a directory listing&lt;/P&gt;
&lt;P&gt;- close the connection&lt;/P&gt;
&lt;P&gt;- hand the output over to SAS as text file&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You cannot delete this, as it is only a virtual file in a pipe.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In order to delete a remote file, you best use an external SFTP utiltity in batch mode and call it with the X statement or CALL SYSTEM from SAS.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 12:29:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-file-on-SFTP-server/m-p/250595#M47259</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-17T12:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting file on SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-file-on-SFTP-server/m-p/250597#M47261</link>
      <description>&lt;P&gt;Hi Kurt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would you formulate the delete statement using the X statement syntax?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 12:38:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-file-on-SFTP-server/m-p/250597#M47261</guid>
      <dc:creator>Frede_1</dc:creator>
      <dc:date>2016-02-17T12:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting file on SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-file-on-SFTP-server/m-p/250599#M47262</link>
      <description>&lt;P&gt;This depends on the SFTP client software you are using.&lt;/P&gt;
&lt;P&gt;For WinSCP, see&lt;/P&gt;
&lt;P&gt;&lt;A href="http://winscp.net/eng/docs/scripting" target="_self"&gt;Scripting and Task Automation&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, with WinSCP, you create a script file&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
file 'C:\temp\wscpscript';
put ....;
put .....;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;X 'winscp /script=c:\temp\wscpscript';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or, if the operation is simple enough, you can use the /command commandline option of WinSCP to enter the whole command sequence that is needed directly in the X statement.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 13:03:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-file-on-SFTP-server/m-p/250599#M47262</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-17T13:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting file on SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-file-on-SFTP-server/m-p/250810#M47316</link>
      <description>&lt;P&gt;Hi Kurt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So what you are saying is that&amp;nbsp;I can't with ordinary Windows or SAS functions delete a file from a SFTP server?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i can't delete a file using SAS or Windows functions, do you know if&amp;nbsp;I can move the file locally on the SFTP server, e.g. from one folder to another?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would prefer not to use an external program like WINSCP to delete/move the file on the SFTP server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Frederik&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 14:04:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-file-on-SFTP-server/m-p/250810#M47316</guid>
      <dc:creator>Frede_1</dc:creator>
      <dc:date>2016-02-18T14:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting file on SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-file-on-SFTP-server/m-p/251029#M47370</link>
      <description>&lt;P&gt;While the FTP access method is built directly into SAS, SAS uses an external sftp client when you specify the SFTP access method in a FILENAME statement. This makes it harder for SAS to use the 3rd-party software to do advanced operations like renaming or deleting files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even setting up SFTP for SAS is not trivial, see here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/techsup/technote/ts800.pdf" target="_self"&gt;https://support.sas.com/techsup/technote/ts800.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The fact that Windows itself does not supply a simple native SFTP client (ie a port of openssh) is just another part of the incompetence in Redmond to get anything right.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you have to use an external client like WinSCP or PuTTY, because that's what SAS itself does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Moving a file on a remote server could be done straight with SAS functions if SAS is installed there (using SAS/CONNECT when appropriately licensed); if SAS is not installed there, you need to get remote access to that server's commandline through some kind of terminal connection (proper terminal emulators like PuTTY can be scripted), or use an SFTP client and route your operations through that.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2016 06:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-file-on-SFTP-server/m-p/251029#M47370</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-19T06:30:56Z</dc:date>
    </item>
  </channel>
</rss>

