<?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: Check Directory Size and Delete Log if Older than XX Days BUT MAKE COPY FIRST in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615083#M179877</link>
    <description>&lt;P&gt;FCOPY copies from one fileref to another: &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n10dz22b5ixohin1vwzilweetek0.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n10dz22b5ixohin1vwzilweetek0.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So using it with the FILENAME function is the way to go.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jan 2020 21:47:17 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2020-01-03T21:47:17Z</dc:date>
    <item>
      <title>Check Directory Size and Delete Log if Older than XX Days BUT MAKE COPY FIRST</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615073#M179871</link>
      <description>&lt;P&gt;I am trying to put a bunch of code I found online together to get it to make a copy of a log file and put it somewhere else before it deletes it BUT ONLY&amp;nbsp;when a directory is running out of space.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to get it to do most of that BUT... I can't get it to copy with a reference to a sas variable... I can get it to do it if I hard code the file name (make&amp;nbsp;a copy that is) but having a hard time with filename specifically...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img id="womansad" class="emoticon emoticon-womansad" src="https://communities.sas.com/i/smilies/16x16_woman-sad.png" alt="Woman Sad" title="Woman Sad" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This is the line I am struggling with:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;filename src &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;loglocation!!\!!memname"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; recfm=n ;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;img id="womansad" class="emoticon emoticon-womansad" src="https://communities.sas.com/i/smilies/16x16_woman-sad.png" alt="Woman Sad" title="Woman Sad" /&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;THIS IS THE REST OF IT... &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;I'm not using the destination reference yet because it's the same problem really... It probably needs a lot of work for other issues as well but for now I just don't know how to get it to take a reference to a sas variable to get the file that it is ON in the loop to MAKE THE COPY...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; mr_clean(loglocation=, destpathcopy=);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data temporary;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;length memname $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;256&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/*Today's date minus 30 days is the date before which we delete*/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;deldate = today() - &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/*filename assigns a file reference to and external file, indir becomes external file */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;rc = filename(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'indir'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;loglocation"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*Obtain directory number from indir to use with other functions*/&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;did = dopen(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'indir'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*If it exists then do the following until the total number of files in directory*/&lt;/P&gt;&lt;P&gt;if did then&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;do i=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; to dnum(did); &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/*Select the i'th file in the directory and give the NAME of the directory member */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;memname = dread(did,i);&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/*From the end of the file if it's .log then continue*/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;if reverse(trim(memname))=: reverse(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'gol.'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) then continue;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/*GIve another file reference but to the full path with the member*/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;rc =filename(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'inmem'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;loglocation/"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;!!memname);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/*Give the file a number*/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;fid = fopen(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'inmem'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;if fid then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;tmp1 = finfo(fid,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Last Modified'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;if scan(tmp1,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'January'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; then month=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'01'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;else if scan(tmp1,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'February'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; then month=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'02'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;else if scan(tmp1,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'March'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; then month=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'03'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;else if scan(tmp1,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'April'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; then month=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'04'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;else if scan(tmp1,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'May'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; then month=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'05'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;else if scan(tmp1,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'June'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; then month=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'06'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;else if scan(tmp1,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'July'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; then month=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'07'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;else if scan(tmp1,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'August'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; then month=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'08'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;else if scan(tmp1,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'September'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; then month=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'09'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;else if scan(tmp1,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'October'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; then month=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'10'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;else if scan(tmp1,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'November'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; then month=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'11'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;else if scan(tmp1,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'December'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; then month=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'12'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;else month =&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'missing'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;tmp2=month||&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'/'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;||scan(tmp1,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)||&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'/'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;||scan(tmp1,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;moddate = input(tmp2, &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;MMDDYY10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rc = fclose(fid);&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;if &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;lt; moddate &amp;lt;= deldate then do;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;filename src &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;loglocation!!\!!memname"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; recfm=n ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;filename dst &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"E:\Logs_copy\SASPrincipalServices9.4.log"&lt;/FONT&gt; &lt;FONT color="#008000" face="Courier New" size="2"&gt;/*recfm=n*/&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; rc1 = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(FCOPY(src,dst));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(SYSMSG());&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;rc = fdelete(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"inmem"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;rc = dclose(did);&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;rc = filename(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'inmem'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;rc = filename(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'indir'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;%mend&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; windows_bytes_free(sm_path=&lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/*, ds_path=*/&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%global&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; mv_bytes_free;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; mv_bytes_free = -1; &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* In case of error */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; filepath = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(quote(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%qsysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(dequote(&amp;amp;sm_path)))); &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* To prevent issues with quotes remove quotes if present and apply it again*/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Run the DIR command and retrieve results using an unnamed pipe */&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;filename tempdir pipe &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(quote(dir /-c &amp;amp;filepath | find &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"bytes free"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;)) ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;infile tempdir length=reclen ;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;input line &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$varying1024.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; reclen ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;re = prxparse(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'/([0-9]+) bytes/'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;); &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* Parse the output of DIR using a Perl regular expression */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if prxmatch(re, line) then do;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;bytes_str = prxposn(re, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;, line);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;bytes = input(bytes_str, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;20.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;call symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'mv_bytes_free'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, bytes); &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* Assign available disk space in bytes to a global macro variable */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;kb = bytes /&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1024&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;mb = kb / &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1024&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;gb = mb / &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1024&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;format bytes &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;comma20.0&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;format kb mb gb &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;comma20.1&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* Write a note to the SAS log */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;put &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"NOTE: &amp;amp;sm_path "&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; bytes= kb= mb= gb=;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;if gb&amp;gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; then call execute(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'%mr_clean(loglocation=&amp;amp;sm_path);'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/*put '** Available space is less than 5 gb';*/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;else put &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'** Enough space is available'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mv_bytes_free eq -&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ERROR: error in windows_bytes_free macro;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;%&lt;STRONG&gt;&lt;I&gt;windows_bytes_free&lt;/I&gt;&lt;/STRONG&gt;(sm_path=D:\SAS\Config\Lev1\Web\Logs\SASServer1_1\Logs_Copy&lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* ds_path=E:\Logs_copy*/&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 21:07:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615073#M179871</guid>
      <dc:creator>kmcnulty1</dc:creator>
      <dc:date>2020-01-03T21:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: Check Directory Size and Delete Log if Older than XX Days BUT MAKE COPY FIRST</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615074#M179872</link>
      <description>&lt;P&gt;This is the error message I am currently getting&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: D:\SAS\Config\Lev1\Web\Logs\SASServer1_1\Logs_Copy bytes=33,067,778,048 kb=32,292,752.0&lt;/P&gt;&lt;P&gt;mb=31,535.9 gb=30.8&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Physical file does not exist, D:\SAS\Config\Lev1\Web\Logs\SASServer1_1\Logs_Copy!!\!!memname.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;NOTE: 1 record was read from the infile TEMPDIR.&lt;/P&gt;&lt;P&gt;The minimum record length was 50.&lt;/P&gt;&lt;P&gt;The maximum record length was 50.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;real time 0.04 seconds&lt;/P&gt;&lt;P&gt;cpu time 0.01 seconds&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 21:19:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615074#M179872</guid>
      <dc:creator>kmcnulty1</dc:creator>
      <dc:date>2020-01-03T21:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: Check Directory Size and Delete Log if Older than XX Days BUT MAKE COPY FIRST</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615078#M179873</link>
      <description>&lt;P&gt;Why aren't you using the FILENAME function instead of the statement as you've done elsewhere in your DATA step? The FILENAME function will work as you intend.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 21:25:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615078#M179873</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-01-03T21:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Check Directory Size and Delete Log if Older than XX Days BUT MAKE COPY FIRST</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615081#M179875</link>
      <description>&lt;P&gt;I was under the impression that this would give it a file reference which I thought was just a number rather than the name and the fcopy I believe just needs a filepath.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;rc =filename(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'inmem'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;loglocation/"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;!!memname);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;What do you think? &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 21:32:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615081#M179875</guid>
      <dc:creator>kmcnulty1</dc:creator>
      <dc:date>2020-01-03T21:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: Check Directory Size and Delete Log if Older than XX Days BUT MAKE COPY FIRST</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615082#M179876</link>
      <description>&lt;P&gt;I tried this too.. It still says it can't find the file. It doesn't resolve memname for some reason. I used dread to get the memname but I don't see why it wouldn't just resolve memname. I don't get it and I feel like I've tried so many options.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;src=filename(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;loglocation/"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;!!memname);&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 21:44:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615082#M179876</guid>
      <dc:creator>kmcnulty1</dc:creator>
      <dc:date>2020-01-03T21:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: Check Directory Size and Delete Log if Older than XX Days BUT MAKE COPY FIRST</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615083#M179877</link>
      <description>&lt;P&gt;FCOPY copies from one fileref to another: &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n10dz22b5ixohin1vwzilweetek0.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n10dz22b5ixohin1vwzilweetek0.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So using it with the FILENAME function is the way to go.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 21:47:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615083#M179877</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-01-03T21:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Check Directory Size and Delete Log if Older than XX Days BUT MAKE COPY FIRST</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615084#M179878</link>
      <description>&lt;P&gt;src resolves to 20014 a number when I do that. Perhaps I don't understand the function as well as you do:)&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 21:48:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615084#M179878</guid>
      <dc:creator>kmcnulty1</dc:creator>
      <dc:date>2020-01-03T21:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Check Directory Size and Delete Log if Older than XX Days BUT MAKE COPY FIRST</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615085#M179879</link>
      <description>&lt;P&gt;Use FILENAME as you did originally and it should work:&lt;/P&gt;
&lt;PRE&gt;rc =filename('inmem',"&amp;amp;loglocation/"!!memname);&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jan 2020 21:50:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615085#M179879</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-01-03T21:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Check Directory Size and Delete Log if Older than XX Days BUT MAKE COPY FIRST</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615086#M179880</link>
      <description>&lt;P&gt;FCOPY requires a fileref which in your case is INMEM. SRC is just the return code off the FILENAME function. You can only use it to check if the function worked OK, nothing else.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rc = fcopy('INMEM','OUTMEM');&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jan 2020 21:56:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615086#M179880</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-01-03T21:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Check Directory Size and Delete Log if Older than XX Days BUT MAKE COPY FIRST</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615366#M179995</link>
      <description>&lt;P&gt;I tried it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rc &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; fcopy&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'INMEM'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'OUTMEM'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still doesn't work for me. The only way I can actually get it to make the copy of the file is with this.. This works but I want it to go through the directory and select the files that meet criteria.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;if &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;lt; moddate &amp;lt;= deldate then do;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;filename src &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"D:\SAS\Config\Lev1\Web\Logs\SASServer1_1\Logs_Copy\SASPrincipalServices9.4.log"&lt;/FONT&gt; &lt;FONT color="#008000" face="Courier New" size="2"&gt;/*recfm=n*/&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;filename dst &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"E:\Logs_Copy\SASPrincipalServices9.4.log"&lt;/FONT&gt; &lt;FONT color="#008000" face="Courier New" size="2"&gt;/*recfm=n*/&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; rc1 = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(FCOPY(src,dst));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;I'll post if I find the solution or please let me know if you have other ideas. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 15:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-Directory-Size-and-Delete-Log-if-Older-than-XX-Days-BUT/m-p/615366#M179995</guid>
      <dc:creator>kmcnulty1</dc:creator>
      <dc:date>2020-01-06T15:07:20Z</dc:date>
    </item>
  </channel>
</rss>

