<?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: Need code to delete multiple files from filepaths in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Need-code-to-delete-multiple-files-from-filepaths/m-p/546405#M8226</link>
    <description>&lt;OL&gt;
&lt;LI&gt;Import the Excel-file.&lt;/LI&gt;
&lt;LI&gt;Use a data-step to process the imported data using the already suggested fdelete function.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;The documentation contains an example explaining how to use &lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0h945u5r0cv6yn1u6qs35hiqt9t.htm&amp;amp;locale=en" target="_self"&gt;fdelete&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Mar 2019 09:21:19 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2019-03-27T09:21:19Z</dc:date>
    <item>
      <title>Need code to delete multiple files from filepaths</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-code-to-delete-multiple-files-from-filepaths/m-p/544196#M7812</link>
      <description>&lt;P&gt;Basically as it says in the title, I have an excel list of files which can be deleted and the filepath is given. How can I delete all of these filepaths in one piece of code?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2019 10:09:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-code-to-delete-multiple-files-from-filepaths/m-p/544196#M7812</guid>
      <dc:creator>Kiy</dc:creator>
      <dc:date>2019-03-19T10:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Need code to delete multiple files from filepaths</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-code-to-delete-multiple-files-from-filepaths/m-p/544197#M7813</link>
      <description>&lt;P&gt;What kind of files? Can you show us the Excel sheet?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2019 10:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-code-to-delete-multiple-files-from-filepaths/m-p/544197#M7813</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-03-19T10:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need code to delete multiple files from filepaths</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-code-to-delete-multiple-files-from-filepaths/m-p/544213#M7815</link>
      <description>&lt;P&gt;Have a look here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/General-SAS-Programming/dynamically-deleting-external-files/td-p/263387" target="_blank"&gt;https://communities.sas.com/t5/General-SAS-Programming/dynamically-deleting-external-files/td-p/263387&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will use the FILENAME and FDELETE functions to do what you want&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2019 12:06:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-code-to-delete-multiple-files-from-filepaths/m-p/544213#M7815</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2019-03-19T12:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Need code to delete multiple files from filepaths</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-code-to-delete-multiple-files-from-filepaths/m-p/546201#M8182</link>
      <description>They are other sas datasets stored within the Same SAS server</description>
      <pubDate>Tue, 26 Mar 2019 15:26:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-code-to-delete-multiple-files-from-filepaths/m-p/546201#M8182</guid>
      <dc:creator>Kiy</dc:creator>
      <dc:date>2019-03-26T15:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need code to delete multiple files from filepaths</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-code-to-delete-multiple-files-from-filepaths/m-p/546203#M8183</link>
      <description>The files are internal within the same SAS server and as a beginner on SAS I am a little confused on where I should fill in the filepaths.</description>
      <pubDate>Tue, 26 Mar 2019 15:29:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-code-to-delete-multiple-files-from-filepaths/m-p/546203#M8183</guid>
      <dc:creator>Kiy</dc:creator>
      <dc:date>2019-03-26T15:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need code to delete multiple files from filepaths</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-code-to-delete-multiple-files-from-filepaths/m-p/546305#M8207</link>
      <description>&lt;P&gt;What does the list of files to delete look like?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Find below a sample program that shows how to use the FILENAME and FDELETE functions. This should help you understand how to use them. Additionally you have to read the documentation of does function as well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*
* file we want to delete
*;
%let myfile = c:\temp\sugus.dat;

%put NOTE: does &amp;amp;myfile exists %sysfunc(fileexist(&amp;amp;myfile)) (1=true 0=false) ;

*
* create file for delete testing
*;
data _null_;
  file "&amp;amp;myfile";
  put "hello world";
run;

%put NOTE: does &amp;amp;myfile exists %sysfunc(fileexist(&amp;amp;myfile)) (1=true 0=false) ;

*
* delete file using FDELETE function, needs a fileref
*;
data _null_;
  rc_assign_fileref = filename("_fd", "&amp;amp;myfile");
  rc_fdelete = fdelete("_fd");
  rc_deassign_fileref = filename("_fd");
  putlog _all_;
run;

%put NOTE: does &amp;amp;myfile exists %sysfunc(fileexist(&amp;amp;myfile)) (1=true 0=false) ;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Mar 2019 20:40:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-code-to-delete-multiple-files-from-filepaths/m-p/546305#M8207</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2019-03-26T20:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Need code to delete multiple files from filepaths</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-code-to-delete-multiple-files-from-filepaths/m-p/546405#M8226</link>
      <description>&lt;OL&gt;
&lt;LI&gt;Import the Excel-file.&lt;/LI&gt;
&lt;LI&gt;Use a data-step to process the imported data using the already suggested fdelete function.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;The documentation contains an example explaining how to use &lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0h945u5r0cv6yn1u6qs35hiqt9t.htm&amp;amp;locale=en" target="_self"&gt;fdelete&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2019 09:21:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-code-to-delete-multiple-files-from-filepaths/m-p/546405#M8226</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-03-27T09:21:19Z</dc:date>
    </item>
  </channel>
</rss>

