<?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 how to delete a SAS file without using PROC DELETE in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19219#M3875</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I don't know how you can unlock a file that is opened in some other task.&lt;/P&gt;&lt;P&gt;What you might be able to do is code a loop that exits once &lt;STRONG&gt;you &lt;/STRONG&gt;can lock the file for your session.&lt;/P&gt;&lt;P&gt;The LOCK statement is documented at &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/a001517609.htm"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/a001517609.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Sep 2011 11:24:52 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2011-09-29T11:24:52Z</dc:date>
    <item>
      <title>how to delete a SAS file without using PROC DELETE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19206#M3862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone have any code that can be used to delete a file that does not involve using proc delete?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 22:07:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19206#M3862</guid>
      <dc:creator>SASguyCO</dc:creator>
      <dc:date>2011-09-28T22:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete a SAS file without using PROC DELETE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19207#M3863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What have you got against proc delete?&amp;nbsp; Do you also want to avoid proc datasets?&amp;nbsp; Based on which operating system you're on would one of the system commands (e.g., x), together with your operating system delete command, be more preferable?&amp;nbsp; Or were you looking for something else altogether?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an alternative that Tom posted on SAS-L a couple of years ago:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro deletedsn(dsn);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if %sysfunc(exist(&amp;amp;dsn,data)) %then %do;&lt;/P&gt;&lt;P&gt; proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; drop table &amp;amp;dsn;&lt;/P&gt;&lt;P&gt; quit;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%if %sysfunc(exist(&amp;amp;dsn,view)) %then %do;&lt;/P&gt;&lt;P&gt; proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; drop view &amp;amp;dsn;&lt;/P&gt;&lt;P&gt; quit;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend deletedsn;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 22:10:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19207#M3863</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-09-28T22:10:39Z</dc:date>
    </item>
    <item>
      <title>how to delete a SAS file without using PROC DELETE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19208#M3864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc datasets library=word; /* you could also use the kill option to delete all datasets from a library */&lt;/P&gt;&lt;P&gt;&amp;nbsp; delete blah;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 22:33:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19208#M3864</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-09-28T22:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete a SAS file without using PROC DELETE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19209#M3865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hey Art!, thanks for responding, I guess I should have been more specific...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I love Proc delete!, but it won't work on a "locked" data set &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem is each night there is some sort of back up running and the data set becomes locked and I need to overwrite it (every night) and the SAS process fails to overwrite as it says the file is locked.&amp;nbsp; I can however, go in and manually delete the data set in windows explorer and then recreate it, but I want to be able to either overwrite the existing one, or delete the old one first (from a locked state) and recreate it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 22:34:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19209#M3865</guid>
      <dc:creator>SASguyCO</dc:creator>
      <dc:date>2011-09-28T22:34:44Z</dc:date>
    </item>
    <item>
      <title>how to delete a SAS file without using PROC DELETE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19210#M3866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Side note... Guessing from you name, are you in Colorado?&amp;nbsp; I am in Boulder.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 22:34:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19210#M3866</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-09-28T22:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete a SAS file without using PROC DELETE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19211#M3867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;x rm -f /location/of/file; /* exact sytax would differ by operating system */&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 22:35:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19211#M3867</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-09-28T22:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete a SAS file without using PROC DELETE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19212#M3868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Tried that FriedEgg, and got the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-size: 12pt; font-family: Courier New;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ERROR: Shell escape is not valid in this SAS session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 22:44:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19212#M3868</guid>
      <dc:creator>SASguyCO</dc:creator>
      <dc:date>2011-09-28T22:44:17Z</dc:date>
    </item>
    <item>
      <title>how to delete a SAS file without using PROC DELETE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19213#M3869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check your options: xcmd, xsync, xwait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 22:53:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19213#M3869</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-09-28T22:53:59Z</dc:date>
    </item>
    <item>
      <title>how to delete a SAS file without using PROC DELETE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19214#M3870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; You'll have to forgive my ignorance on this, but what do you mean by check your options: xcmd, xsync, xwait?&amp;nbsp; How do I do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I should state I'm doing all this in SAS EG but within actual code.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 23:05:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19214#M3870</guid>
      <dc:creator>SASguyCO</dc:creator>
      <dc:date>2011-09-28T23:05:42Z</dc:date>
    </item>
    <item>
      <title>how to delete a SAS file without using PROC DELETE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19215#M3871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take a look at:&lt;/P&gt;&lt;P&gt;&lt;A href="http://blogs.sas.com/sasdummy/index.php?/archives/136-Using-the-X-and-SYSTASK-commands-from-SAS-Enterprise-Guide.html"&gt;http://blogs.sas.com/sasdummy/index.php?/archives/136-Using-the-X-and-SYSTASK-commands-from-SAS-Enterprise-Guide.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 23:15:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19215#M3871</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-09-28T23:15:53Z</dc:date>
    </item>
    <item>
      <title>how to delete a SAS file without using PROC DELETE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19216#M3872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt; array opt[3] $5 ('xcmd' 'xsync' 'xwait');&lt;/P&gt;&lt;P&gt;do i=1 to 3;&lt;/P&gt;&lt;P&gt;call execute('proc options option=' || strip(opt&lt;I&gt;) || '; run;');&lt;/I&gt;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xcmd is the most important.&amp;nbsp; If it is not defined you, or your sas administator will have to enable it in the config file for the server you are connecting to.&amp;nbsp; It is probably not enabled for a reason, which means you are out of luck... &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 23:16:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19216#M3872</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-09-28T23:16:14Z</dc:date>
    </item>
    <item>
      <title>how to delete a SAS file without using PROC DELETE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19217#M3873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good information Art.&amp;nbsp; I cannot claim to be very familiar with EG administation (even though I do it sometimes, yikes!)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 23:20:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19217#M3873</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-09-28T23:20:15Z</dc:date>
    </item>
    <item>
      <title>how to delete a SAS file without using PROC DELETE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19218#M3874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks again Art and FriedEgg.&amp;nbsp; Looks like it's not defined.&amp;nbsp; I looked at the link Art and it's certainly helpful.&amp;nbsp; Option 2 won't fly for sure, and option 1 requires me to gain admin rights which they will want to know what for so I'm not sure they'll let me go about it that way either.&amp;nbsp; Appreciate the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 23:34:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19218#M3874</guid>
      <dc:creator>SASguyCO</dc:creator>
      <dc:date>2011-09-28T23:34:34Z</dc:date>
    </item>
    <item>
      <title>how to delete a SAS file without using PROC DELETE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19219#M3875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I don't know how you can unlock a file that is opened in some other task.&lt;/P&gt;&lt;P&gt;What you might be able to do is code a loop that exits once &lt;STRONG&gt;you &lt;/STRONG&gt;can lock the file for your session.&lt;/P&gt;&lt;P&gt;The LOCK statement is documented at &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/a001517609.htm"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/a001517609.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2011 11:24:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19219#M3875</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-09-29T11:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete a SAS file without using PROC DELETE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19220#M3876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Throwing in my 2 cents worth....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like you need to delete the entire dataset rather than a single SAS table.&amp;nbsp; My first course of action would be to identify who has the lock on the file, otherwise we have had success just running a DOS command to delete the file at the appropriate time.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a sample where we clean out a dataset of all html files before rewriting them.&amp;nbsp; This could be easily change to delete the entire file.&amp;nbsp; Just run the macro with the name of the file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro deletefile(filen);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %let delcmd1 = DEL "&amp;amp;prefix.\*.html ";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %put deleting &amp;amp;filen data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; X &amp;amp;delcmd1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2011 12:33:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-delete-a-SAS-file-without-using-PROC-DELETE/m-p/19220#M3876</guid>
      <dc:creator>OS2Rules</dc:creator>
      <dc:date>2011-09-29T12:33:59Z</dc:date>
    </item>
  </channel>
</rss>

