<?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 Check and delete windows directory in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Check-and-delete-windows-directory/m-p/315479#M68825</link>
    <description>&lt;P&gt;I would like to check if a windows directory is empty, if so delete it otherwise end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this possible via SAS Base 9.4 and Windows 7&lt;/P&gt;</description>
    <pubDate>Wed, 30 Nov 2016 11:33:49 GMT</pubDate>
    <dc:creator>jp007_uk</dc:creator>
    <dc:date>2016-11-30T11:33:49Z</dc:date>
    <item>
      <title>Check and delete windows directory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-and-delete-windows-directory/m-p/315479#M68825</link>
      <description>&lt;P&gt;I would like to check if a windows directory is empty, if so delete it otherwise end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this possible via SAS Base 9.4 and Windows 7&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 11:33:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-and-delete-windows-directory/m-p/315479#M68825</guid>
      <dc:creator>jp007_uk</dc:creator>
      <dc:date>2016-11-30T11:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Check and delete windows directory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-and-delete-windows-directory/m-p/315486#M68829</link>
      <description>&lt;P&gt;Its possible, and there are a few options. &amp;nbsp;You could stream in a dir pipe (not tested):&lt;/P&gt;
&lt;P&gt;filename tmp pipe 'dir "c:\temp" /b';&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; infile tmp dlm="¬";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; input buffer $;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if buffer="your dir" then found=1;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you could do it in a macro:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/Tips:Check_if_a_directory_exists" target="_blank"&gt;http://www.sascommunity.org/wiki/Tips:Check_if_a_directory_exists&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And to delete:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000245893.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000245893.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The question is, why. &amp;nbsp;I generally try to avoid doing OS manipulations through SAS, especially through macro, as an unresolved macro, or problem url could lead to all kinds of problems. &amp;nbsp;Most of the time I find there are systematci problems if your having to do this anyways.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 11:52:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-and-delete-windows-directory/m-p/315486#M68829</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-30T11:52:47Z</dc:date>
    </item>
  </channel>
</rss>

