<?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: Clean .bak files from PROC EXPORT in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/587105#M167635</link>
    <description>&lt;P&gt;Hi Laurie,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're absolutely right about the copyright attribution.&amp;nbsp; It was a cut-and-paste error from my standard macro header, for which I sincerely apologize.&amp;nbsp; Really...I apologize.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I always try to give full attribution to original authors of code, or code portions (see %seplist, %export, %export_dlm, and %parmv, among others).&amp;nbsp; Your code is in fact 8 lines of a 500+ line macro - I do consider the rest of the macro to be derived independently of your post.&amp;nbsp; But, again, I was wrong for not giving you attribution for your approach to .bak files created by PROC COPY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I only include the copyright notice because I wish to make it crystal clear that any code I put in that repository to be freely available to anyone who wants to use it.&amp;nbsp; AFAIK, it is a recommended approach by GitHub to give clarity to code reuse by others.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have corrected the header, giving full attribution to your original post.&amp;nbsp; Please have a look, and if you wish any further changes, please let me know.&amp;nbsp; I assumed your approach to be in the public domain by virtue of your post to this forum.&amp;nbsp; If you disagree, let me know, preferably via PM.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was also incorrect about the data step vs. macro variable difference.&amp;nbsp; I must have been having a bad day :-/.&amp;nbsp; I have corrected my post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regardless, thanks for your solution to the OP.&amp;nbsp; It gave me the idea to solve my issue via my macro implementation of your original idea.&lt;/P&gt;</description>
    <pubDate>Sun, 08 Sep 2019 22:23:52 GMT</pubDate>
    <dc:creator>ScottBass</dc:creator>
    <dc:date>2019-09-08T22:23:52Z</dc:date>
    <item>
      <title>Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/316201#M69068</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I want to export a data set to "sheet1" into an excel file and if the data already exists in "sheet1", then replace it.&lt;/P&gt;&lt;P&gt;If the file is replaced, then a backup file is generated.&lt;/P&gt;&lt;P&gt;In location c: I will have a file 'test.xls' and 'test.xls.bak'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC EXPORT DATA=data1&lt;/P&gt;&lt;P&gt;OUTFILE="c:\test.xls"&lt;/P&gt;&lt;P&gt;DBMS=xls REPLACE;&lt;/P&gt;&lt;P&gt;SHEET="sheet1";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Is there a way to to stop it from doing the backups? Thank you, Fp&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 10:51:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/316201#M69068</guid>
      <dc:creator>felyp222</dc:creator>
      <dc:date>2016-12-02T10:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/316215#M69071</link>
      <description>&lt;P&gt;Per &lt;A href="http://support.sas.com/kb/37/485.html" target="_blank"&gt;http://support.sas.com/kb/37/485.html&lt;/A&gt;, there is no workaround at the time.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 11:23:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/316215#M69071</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-12-02T11:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/316218#M69072</link>
      <description>&lt;P&gt;Does the same thing happen if you create an XLSX file instead?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And can you use FDELETE () to manually clean up, since you know it will occur.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 11:31:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/316218#M69072</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-02T11:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/359193#M84470</link>
      <description>Kurt have there been any updates on this issue? It is a bit of a pain in a version-controlled environment.</description>
      <pubDate>Tue, 16 May 2017 20:33:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/359193#M84470</guid>
      <dc:creator>Doug____</dc:creator>
      <dc:date>2017-05-16T20:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/359198#M84471</link>
      <description>Any updates on this?</description>
      <pubDate>Tue, 16 May 2017 20:44:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/359198#M84471</guid>
      <dc:creator>Doug____</dc:creator>
      <dc:date>2017-05-16T20:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/362602#M85677</link>
      <description>&lt;P&gt;I just found myself in the same position, so I wrote a macro for it (assuming that&amp;nbsp;&lt;EM&gt;file&lt;/EM&gt; is the name of the spreadsheet without the&amp;nbsp;&lt;EM&gt;.xlsx&lt;/EM&gt; suffix:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro xlsx_bak_delete(file=) / des='Delete backup spreadsheets';
option mprint notes;
data _null_;
fname = 'todelete';
rc = filename(fname, "&amp;amp;file..xlsx.bak");
rc = fdelete(fname);
rc = filename(fname);
run;
%mend xlsx_bak_delete;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It does no checking whether the file exists, and doesn't put out any fancy messages. It just does what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Obviously, if you're using&amp;nbsp;&lt;EM&gt;xls&lt;/EM&gt;, modify to suit.)&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 04:15:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/362602#M85677</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2017-05-30T04:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/362619#M85682</link>
      <description>Thank you so much!&lt;BR /&gt;This is what I was looking for&lt;BR /&gt;&lt;BR /&gt;Feli</description>
      <pubDate>Tue, 30 May 2017 05:57:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/362619#M85682</guid>
      <dc:creator>Fely</dc:creator>
      <dc:date>2017-05-30T05:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/363149#M85917</link>
      <description>&lt;P&gt;I tried to use another engine to export as xlsx file. It looks working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DBMS=excel&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 16:39:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/363149#M85917</guid>
      <dc:creator>Iris22</dc:creator>
      <dc:date>2017-05-31T16:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/395610#M95451</link>
      <description>&lt;P&gt;I apologize in advance but I am still pretty new at SAS. I can't get this macro to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assuming my file name is "noobie", can you tell me what I need to replace in the macro?&amp;nbsp; Again, my apologies but I have .bak files everywhere and they are driving me insane!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2017 16:23:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/395610#M95451</guid>
      <dc:creator>LRH</dc:creator>
      <dc:date>2017-09-13T16:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/395618#M95453</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/164787"&gt;@LRH&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I apologize in advance but I am still pretty new at SAS. I can't get this macro to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming my file name is "noobie", can you tell me what I need to replace in the macro?&amp;nbsp; Again, my apologies but I have .bak files everywhere and they are driving me insane!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You don't replace anything in the macro (actually REPLACING things is what macros are desgined to do &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ).&lt;/P&gt;
&lt;P&gt;You just CALL the macro with the name of your file. &amp;nbsp;So if you call it like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%xlsx_bak_delete(file=noobie) ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It will try to delete a file named "noobie.xlsx.bak".&lt;/P&gt;
&lt;P&gt;If the file is not in the current working directory (of the SAS process that is running your macro call) then you might need to add a path. For example if you have been creating your XLSX files on a shared foder using SAS running on Windows then your call might look like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%xlsx_bak_delete(file=\\servername\sharename\foldername\noobie) ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Sep 2017 16:33:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/395618#M95453</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-09-13T16:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/395642#M95460</link>
      <description>&lt;P&gt;Amazing! Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2017 17:00:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/395642#M95460</guid>
      <dc:creator>LRH</dc:creator>
      <dc:date>2017-09-13T17:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/471908#M120918</link>
      <description>&lt;P&gt;This worked for me!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 20:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/471908#M120918</guid>
      <dc:creator>njr</dc:creator>
      <dc:date>2018-06-20T20:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/485789#M126257</link>
      <description>&lt;P&gt;I am apparently even more of a novice than the individual in the prior post.&amp;nbsp;My code is below. It runs without error, but does not delete the file. Any insight would really be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro xlsx_bak_delete (file="\\high21\sys\GROUP\ACTUARY\Dividend\20180701 Dividend\Dividend_Data") / des = 'Delete Backup Spreadsheets';&lt;BR /&gt;option mprint notes;&lt;BR /&gt;data _null_;&lt;BR /&gt;fname = 'todelete';&lt;BR /&gt;rc = filename(fname, "&amp;amp;file..xlsx.bak");&lt;BR /&gt;rc = fdelete(fname);&lt;BR /&gt;rc = filename(fname);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%mend xlsx_bak_delete;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 14:38:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/485789#M126257</guid>
      <dc:creator>NormaO</dc:creator>
      <dc:date>2018-08-10T14:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/485867#M126287</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/216453"&gt;@NormaO&lt;/a&gt;&amp;nbsp;it helps if you post as a new thread so everyone can see this post. Otherwise, only users who previously interacted with this thread will see it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change the data _null_ to have a data set name and check the RC values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro xlsx_bak_delete (file="\\high21\sys\GROUP\ACTUARY\Dividend\20180701 Dividend\Dividend_Data") / des = 'Delete Backup Spreadsheets';
option mprint notes;
data demo;
fname = 'todelete';
rc = filename(fname, "&amp;amp;file..xlsx.bak");
rc = fdelete(fname);
rc = filename(fname);
run;
 
%mend xlsx_bak_delete;

proc print data=demo;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Aug 2018 16:55:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/485867#M126287</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-10T16:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/485899#M126301</link>
      <description>&lt;P&gt;Thank you! I am already messing up on my first post &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 17:59:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/485899#M126301</guid>
      <dc:creator>NormaO</dc:creator>
      <dc:date>2018-08-10T17:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/553041#M153758</link>
      <description>&lt;P&gt;Here is another solution that calls cmd through SAS using the x command (file path needs to be quoted).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro delete_bak(xlsx_path);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;option noxwait;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;x del /f &amp;amp;xlsx_path..bak;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2019 20:28:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/553041#M153758</guid>
      <dc:creator>RLANG1152</dc:creator>
      <dc:date>2019-04-22T20:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/553049#M153761</link>
      <description>&lt;P&gt;External commands are rarely, if ever, permitted at virtually all the sites I've worked at. Since I wrote that macro particularly to deal with loading spreadsheets from within SAS/DI, the LSF userid was locked down even more, so there was no way it would be allowed. On top of that, it was a Linux site...&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2019 20:48:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/553049#M153761</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2019-04-22T20:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/553120#M153783</link>
      <description>Fair enough... the company I work for uses a Windows based server and&lt;BR /&gt;allows things like this so this was the solution that I used. Thanks for&lt;BR /&gt;the reply and the info.&lt;BR /&gt;&lt;BR /&gt;Rob&lt;BR /&gt;</description>
      <pubDate>Tue, 23 Apr 2019 03:49:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/553120#M153783</guid>
      <dc:creator>RLANG1152</dc:creator>
      <dc:date>2019-04-23T03:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/586572#M167444</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/17429"&gt;@LaurieF&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I just found myself in the same position, so I wrote a macro for it (assuming that&amp;nbsp;&lt;EM&gt;file&lt;/EM&gt; is the name of the spreadsheet without the&amp;nbsp;&lt;EM&gt;.xlsx&lt;/EM&gt; suffix:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro xlsx_bak_delete(file=) / des='Delete backup spreadsheets';
option mprint notes;
data _null_;
fname = 'todelete';
rc = filename(fname, "&amp;amp;file..xlsx.bak");
rc = fdelete(fname);
rc = filename(fname);
run;
%mend xlsx_bak_delete;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It does no checking whether the file exists, and doesn't put out any fancy messages. It just does what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Obviously, if you're using&amp;nbsp;&lt;EM&gt;xls&lt;/EM&gt;, modify to suit.)&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi Laurie,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks so much for this approach to this issue.&amp;nbsp; It is a simple, straightforward solution to PROC COPY creating these .bak files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you/someone want to implement this solution as a "pure macro" approach vs. data step, there is a subtle difference:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rc = filename(fname, "&amp;amp;file..xlsx.bak");
rc = fdelete(&lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;&amp;amp;&lt;/STRONG&gt;&lt;/FONT&gt;fname);  * &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; (needs ampersand) ;
rc = filename(fname);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again, thanks for this idea.&amp;nbsp; I have incorporated it into this macro (scroll to the bottom):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/scottbass/SAS/blob/master/export_dbms.sas" target="_blank" rel="noopener"&gt;https://github.com/scottbass/SAS/blob/master/export_dbms.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I acknowledge the use of your ideas in this macro.&amp;nbsp; Please let me know if you have any issues, as I assumed your ideas to be in the public domain by virtue of your post.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Sep 2019 21:49:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/586572#M167444</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-09-08T21:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: Clean .bak files from PROC EXPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/586595#M167461</link>
      <description>There’s no bug in the code. fname is a data step variable, not a macro variable. It works exactly as intended.&lt;BR /&gt;&lt;BR /&gt;And you’ve got your copyright attribution on *my* code. That’s a bit **bleep**. &lt;BR /&gt;&lt;BR /&gt;Laurie&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Sep 2019 01:47:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clean-bak-files-from-PROC-EXPORT/m-p/586595#M167461</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2019-09-06T01:47:35Z</dc:date>
    </item>
  </channel>
</rss>

