<?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: delete all .png in a library in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/delete-all-png-in-a-library/m-p/74489#M21624</link>
    <description>You can also use statements:&lt;BR /&gt;
&lt;BR /&gt;
   %let path=%sysfunc(pathname(mylib));&lt;BR /&gt;
   systask command&lt;BR /&gt;
   "del ""&amp;amp;path.\*.png"""&lt;BR /&gt;
   wait taskname="deleting";</description>
    <pubDate>Wed, 07 Oct 2009 06:59:56 GMT</pubDate>
    <dc:creator>Oleg_L</dc:creator>
    <dc:date>2009-10-07T06:59:56Z</dc:date>
    <item>
      <title>delete all .png in a library</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-all-png-in-a-library/m-p/74486#M21621</link>
      <description>Hello dears SAS users&lt;BR /&gt;
I have a library called mylib with .png inside and i want to delete all the png picture of this library with a code like &lt;BR /&gt;
data _null_ ;&lt;BR /&gt;
  call system("cd &amp;amp;pathUser. ; pwd ; mkdir &amp;amp;userID.;") ;&lt;BR /&gt;
run ;&lt;BR /&gt;
but i don't know the code to do it&lt;BR /&gt;
Could you help me please ?&lt;BR /&gt;
thank you</description>
      <pubDate>Tue, 06 Oct 2009 12:50:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-all-png-in-a-library/m-p/74486#M21621</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-10-06T12:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: delete all .png in a library</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-all-png-in-a-library/m-p/74487#M21622</link>
      <description>Have a look at the SAS documentation and your particular SAS OS companion guide.  The FILENAME &lt;FILEREF&gt; PIPE engine provides a means to generate commands.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
SAS Support website and hosted Documentation:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/onlinedoc/base/index.html" target="_blank"&gt;http://support.sas.com/documentation/onlinedoc/base/index.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Example for Unix:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/hostunx/61879/HTML/default/pipe.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/hostunx/61879/HTML/default/pipe.htm&lt;/A&gt;&lt;/FILEREF&gt;</description>
      <pubDate>Tue, 06 Oct 2009 13:21:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-all-png-in-a-library/m-p/74487#M21622</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-10-06T13:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: delete all .png in a library</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-all-png-in-a-library/m-p/74488#M21623</link>
      <description>Hello.&lt;BR /&gt;
You can try this code&lt;BR /&gt;
&lt;BR /&gt;
 %macro dirclear(dir=d:\test,ext=xls);&lt;BR /&gt;
 %let ext=%upcase(&amp;amp;ext);&lt;BR /&gt;
 %let dlm=\;&lt;BR /&gt;
 %let filrf=;&lt;BR /&gt;
 %let rc=%sysfunc(filename(filrf,"&amp;amp;dir"));&lt;BR /&gt;
 %let did=%sysfunc(dopen(&amp;amp;filrf));&lt;BR /&gt;
 %let lstname=;&lt;BR /&gt;
 %let memcount=%sysfunc(dnum(&amp;amp;did));&lt;BR /&gt;
 %if &amp;amp;memcount &amp;gt; 0 %then %do;&lt;BR /&gt;
 %do i=1 %to &amp;amp;memcount;&lt;BR /&gt;
 %let lstname=%sysfunc(dread(&amp;amp;did,&amp;amp;i));&lt;BR /&gt;
 %let file=&amp;amp;dir&amp;amp;dlm&amp;amp;lstname;&lt;BR /&gt;
 %let ln=%length(&amp;amp;lstname);&lt;BR /&gt;
  data _null_;&lt;BR /&gt;
  c="&amp;amp;lstname"; c1=reverse(c); ln1=index(c1,'.'); ln=&amp;amp;ln-ln1+2; ln3=ln1-1;&lt;BR /&gt;
  ln4=upcase(substr(c,ln,ln3));&lt;BR /&gt;
  call symput('ln2',trim(left(ln4)));&lt;BR /&gt;
  run;&lt;BR /&gt;
 %if &amp;amp;ln2=&amp;amp;ext or &amp;amp;ext= %then %do;&lt;BR /&gt;
 %let rb=%sysfunc(filename(fname,"&amp;amp;file"));&lt;BR /&gt;
 %let rv=%sysfunc(fdelete(&amp;amp;fname));&lt;BR /&gt;
 %end; %end; %end;&lt;BR /&gt;
 %let rc=%sysfunc(dclose(&amp;amp;did));&lt;BR /&gt;
 %mend dirclear;&lt;BR /&gt;
&lt;BR /&gt;
   %let path=%sysfunc(pathname(mylib));&lt;BR /&gt;
  %dirclear(dir=&amp;amp;path,ext=png)</description>
      <pubDate>Wed, 07 Oct 2009 04:41:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-all-png-in-a-library/m-p/74488#M21623</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2009-10-07T04:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: delete all .png in a library</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-all-png-in-a-library/m-p/74489#M21624</link>
      <description>You can also use statements:&lt;BR /&gt;
&lt;BR /&gt;
   %let path=%sysfunc(pathname(mylib));&lt;BR /&gt;
   systask command&lt;BR /&gt;
   "del ""&amp;amp;path.\*.png"""&lt;BR /&gt;
   wait taskname="deleting";</description>
      <pubDate>Wed, 07 Oct 2009 06:59:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-all-png-in-a-library/m-p/74489#M21624</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2009-10-07T06:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: delete all .png in a library</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-all-png-in-a-library/m-p/74490#M21625</link>
      <description>Thank yoy&lt;BR /&gt;
oleg, i prefer your second solution &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Wed, 07 Oct 2009 08:37:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-all-png-in-a-library/m-p/74490#M21625</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-10-07T08:37:00Z</dc:date>
    </item>
  </channel>
</rss>

