<?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: Deletion of Log Files in SAS in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/Deletion-of-Log-Files-in-SAS/m-p/827746#M24820</link>
    <description>&lt;P&gt;I want this through SAS DI Studio job or any other script which will get auto triggered&lt;/P&gt;</description>
    <pubDate>Tue, 09 Aug 2022 05:09:14 GMT</pubDate>
    <dc:creator>laxmanpai</dc:creator>
    <dc:date>2022-08-09T05:09:14Z</dc:date>
    <item>
      <title>Deletion of Log Files in SAS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Deletion-of-Log-Files-in-SAS/m-p/827745#M24819</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you let me know how to delete the log files from the Logs Folder in SAS which are older than 1 month.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently i am manually deleting the files from this folder.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a SAS job which can be written or any script which can be auto triggered ?.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Laxman&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 05:08:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Deletion-of-Log-Files-in-SAS/m-p/827745#M24819</guid>
      <dc:creator>laxmanpai</dc:creator>
      <dc:date>2022-08-09T05:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Deletion of Log Files in SAS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Deletion-of-Log-Files-in-SAS/m-p/827746#M24820</link>
      <description>&lt;P&gt;I want this through SAS DI Studio job or any other script which will get auto triggered&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 05:09:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Deletion-of-Log-Files-in-SAS/m-p/827746#M24820</guid>
      <dc:creator>laxmanpai</dc:creator>
      <dc:date>2022-08-09T05:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Deletion of Log Files in SAS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Deletion-of-Log-Files-in-SAS/m-p/827752#M24821</link>
      <description>&lt;P&gt;A solution depends on the os of the sas server. On a windows server i would use something like the solution posted on &lt;A href="https://stackoverflow.com/questions/17829785/delete-files-older-than-15-days-using-powershell" target="_blank"&gt;https://stackoverflow.com/questions/17829785/delete-files-older-than-15-days-using-powershell&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 05:58:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Deletion-of-Log-Files-in-SAS/m-p/827752#M24821</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-08-09T05:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Deletion of Log Files in SAS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Deletion-of-Log-Files-in-SAS/m-p/828018#M24840</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also wanted to know whether it can be done through SAS jobs in DI studio.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 03:35:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Deletion-of-Log-Files-in-SAS/m-p/828018#M24840</guid>
      <dc:creator>laxmanpai</dc:creator>
      <dc:date>2022-08-10T03:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Deletion of Log Files in SAS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Deletion-of-Log-Files-in-SAS/m-p/828020#M24842</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/28829"&gt;@laxmanpai&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also wanted to know whether it can be done through SAS jobs in DI studio.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;DI Studio is just generating and executing SAS code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If XCMD is set you can execute OS level commands via SAS.&lt;/P&gt;
&lt;P&gt;Proc Options option=xcmd; run;&amp;nbsp; will tell you what's set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF your compute server where SAS executes is Unix/Linux then what you want can be done with a single command (Unix find ) that you then can call out of SAS via Filename pipe or system()/call system();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using DIS just a single node with user written code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 03:44:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Deletion-of-Log-Files-in-SAS/m-p/828020#M24842</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-08-10T03:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Deletion of Log Files in SAS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Deletion-of-Log-Files-in-SAS/m-p/828036#M24845</link>
      <description>&lt;P&gt;See this piece of SAS code which extracts the modification timestamp for files in a directory:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data times;
length dref fref $8 fname $200;
rc = filename(dref,"name of your logs directory");
did = dopen(dref);
if did
then do;
  do i = 1 to dnum(did);
    fname = dread(did,i);
    rc = filename(fref,cats("~/",fname));
    fid = fopen(fref);
    if fid
    then do;
      modified = input(finfo(fid,foptname(fid,5)),nldatm30.);
      rc = fclose(fid);
      output;
    end;
    rc = filename(fref);
  end;
  rc = dclose(did);
end;
rc = filename(dref);
format modified e8601dt19.;
drop dref fref rc did fid i;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;From this dataset, you can then run a data step which uses the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/lefunctionsref/p0h945u5r0cv6yn1u6qs35hiqt9t.htm" target="_blank" rel="noopener"&gt;FDELETE Function&lt;/A&gt;&amp;nbsp; (if you're comfortable with the code once you tested it, you can add the FDELETE immediately before the OUTPUT).&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 07:27:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Deletion-of-Log-Files-in-SAS/m-p/828036#M24845</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-08-10T07:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Deletion of Log Files in SAS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Deletion-of-Log-Files-in-SAS/m-p/828215#M24851</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 06:59:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Deletion-of-Log-Files-in-SAS/m-p/828215#M24851</guid>
      <dc:creator>laxmanpai</dc:creator>
      <dc:date>2022-08-11T06:59:05Z</dc:date>
    </item>
  </channel>
</rss>

