<?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 Can I clear my log at the end of each loop? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Can-I-clear-my-log-at-the-end-of-each-loop/m-p/628986#M185931</link>
    <description>&lt;P&gt;I have the following macro:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO Loop_1;
	%DO i = 1 %TO 500 ;
		%Macro_first(&amp;amp;i);
	%END;
%MEND Loop_1;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The problem is that after a certain amount of loops, the log window becomes full and needs to be cleared before the code progresses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I googled this, and found:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;dm 'log;clear;';&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But I can't seem to implement it.&lt;/P&gt;&lt;P&gt;If I put it outside the loop, it doesn't work (obviously).&lt;/P&gt;&lt;P&gt;If I put it in inside the loop, the "dm" stays black, so it seems that it's not registering properly as a SAS statement, and when I use&lt;/P&gt;&lt;P&gt;%dm, it's being read as a macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Mar 2020 01:00:41 GMT</pubDate>
    <dc:creator>UniversitySas</dc:creator>
    <dc:date>2020-03-03T01:00:41Z</dc:date>
    <item>
      <title>Can I clear my log at the end of each loop?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-I-clear-my-log-at-the-end-of-each-loop/m-p/628986#M185931</link>
      <description>&lt;P&gt;I have the following macro:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO Loop_1;
	%DO i = 1 %TO 500 ;
		%Macro_first(&amp;amp;i);
	%END;
%MEND Loop_1;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The problem is that after a certain amount of loops, the log window becomes full and needs to be cleared before the code progresses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I googled this, and found:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;dm 'log;clear;';&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But I can't seem to implement it.&lt;/P&gt;&lt;P&gt;If I put it outside the loop, it doesn't work (obviously).&lt;/P&gt;&lt;P&gt;If I put it in inside the loop, the "dm" stays black, so it seems that it's not registering properly as a SAS statement, and when I use&lt;/P&gt;&lt;P&gt;%dm, it's being read as a macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 01:00:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-I-clear-my-log-at-the-end-of-each-loop/m-p/628986#M185931</guid>
      <dc:creator>UniversitySas</dc:creator>
      <dc:date>2020-03-03T01:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can I clear my log at the end of each loop?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-I-clear-my-log-at-the-end-of-each-loop/m-p/628989#M185933</link>
      <description>&lt;P&gt;Don't do a clear. Use PROC PRINTTO to write the log to a file. If there is an error somewhere, then you can view the log in the file. If you do a clear, errors are gone.&lt;/P&gt;
&lt;DIV id="tap-translate"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 03 Mar 2020 17:38:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-I-clear-my-log-at-the-end-of-each-loop/m-p/628989#M185933</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-03-03T17:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can I clear my log at the end of each loop?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-I-clear-my-log-at-the-end-of-each-loop/m-p/628991#M185935</link>
      <description>&lt;P&gt;If your log is that big and it takes a considerable time to run then consider running your program as a batch SAS job then your log can grow as big as necessary.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 01:24:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-I-clear-my-log-at-the-end-of-each-loop/m-p/628991#M185935</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-03-03T01:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Can I clear my log at the end of each loop?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-I-clear-my-log-at-the-end-of-each-loop/m-p/629000#M185941</link>
      <description>Turn off the output using NOPRINT when available and use 'option nonotes;' to only have errors and warnings printed to the log. As someone else indicated though, using BY group processing would fix this issue entirely.</description>
      <pubDate>Tue, 03 Mar 2020 02:13:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-I-clear-my-log-at-the-end-of-each-loop/m-p/629000#M185941</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-03-03T02:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can I clear my log at the end of each loop?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-I-clear-my-log-at-the-end-of-each-loop/m-p/629190#M186032</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/95638"&gt;@UniversitySas&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have the following macro:&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;I googled this, and found:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;dm 'log;clear;';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I can't seem to implement it.&lt;/P&gt;
&lt;P&gt;If I put it outside the loop, it doesn't work (obviously).&lt;/P&gt;
&lt;P&gt;If I put it in inside the loop, the "dm" stays black, so it seems that it's not registering properly as a SAS statement, and when I use&lt;/P&gt;
&lt;P&gt;%dm, it's being read as a macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is appreciated!&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The "DM" in " dm 'log; clear'; " refers to Display Manager, the SAS interface that is sometimes referred to as Base or Foundation SAS. So if you are working in SAS Studio, Enterprise Guide or Viya I would not expect that to work.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 16:55:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-I-clear-my-log-at-the-end-of-each-loop/m-p/629190#M186032</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-03-03T16:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can I clear my log at the end of each loop?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-I-clear-my-log-at-the-end-of-each-loop/m-p/629252#M186052</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/95638"&gt;@UniversitySas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can route the log to a file with Proc Printto (or to "nowhere" by using the file name dummy) before you enter the loop. Remember to route it back to the log window after the loop:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* Disable logging;
filename mylog dummy;
proc printto log=mylog;
run;

* Useless macro generating long log;
%macro m;
	%do i = 1 %to 100;
		data test; 
			 a = 1;
		run;
	%end;
%mend;
%m;

* Enable logging;
proc printto;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 20:25:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-I-clear-my-log-at-the-end-of-each-loop/m-p/629252#M186052</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2020-03-03T20:25:22Z</dc:date>
    </item>
  </channel>
</rss>

