<?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: How to force updates to SAS Log? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-force-updates-to-SAS-Log/m-p/413998#M101398</link>
    <description>&lt;P&gt;Try adding -logparm "write=immediate" to your SAS invocation as in this link&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002303556.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002303556.htm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Nov 2017 13:55:38 GMT</pubDate>
    <dc:creator>ChrisBrooks</dc:creator>
    <dc:date>2017-11-16T13:55:38Z</dc:date>
    <item>
      <title>How to force updates to SAS Log?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-force-updates-to-SAS-Log/m-p/413993#M101396</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running a SAS program on UNIX, but I think my question applies to all platforms.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My program runs the&amp;nbsp;code shown below. The macro variable _ENV resolves to DEV or UAT or PROD to show the runtime environment. The code executes a waiting period to allow&amp;nbsp;another process time to complete.&amp;nbsp;In DEV the waiting time is set smaller because we have smaller data. The INFO message to the SAS Log is designed to show anybody monitoring the SAS Log how long they can expect to wait for progress.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the INFO message usually does not appear in the SAS Log until after the waiting period is already finished. I&amp;nbsp;guess this is because the SAS Log is updated in "pages", and will only be&amp;nbsp;refreshed after a certain number of lines are available to be written to it. &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any SAS statement which can force&amp;nbsp;the SAS Log to be&amp;nbsp;updated/refreshed immediately?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any SAS option which can set the SAS Log to be updated with greater frequency?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Antony&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sleepmins=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(IFN(&amp;amp;_ENV.=DEV,5,30));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;gt;&amp;gt;&amp;gt; INFO: Sleeping for &amp;amp;sleepmins. minutes in &amp;amp;_ENV. to allow ORACLE Loading to complete.;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; slept=sleep(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;60&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;*&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;sleepmins.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 13:36:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-force-updates-to-SAS-Log/m-p/413993#M101396</guid>
      <dc:creator>aknight1</dc:creator>
      <dc:date>2017-11-16T13:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to force updates to SAS Log?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-force-updates-to-SAS-Log/m-p/413998#M101398</link>
      <description>&lt;P&gt;Try adding -logparm "write=immediate" to your SAS invocation as in this link&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002303556.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002303556.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 13:55:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-force-updates-to-SAS-Log/m-p/413998#M101398</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-11-16T13:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to force updates to SAS Log?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-force-updates-to-SAS-Log/m-p/414032#M101410</link>
      <description>&lt;P&gt;Hi Mr Brooks . . .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks VERY much for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As luck would have it, I'm in a position to be able to alter the shell script that kicks off our UNIX programs. So I'm able to extend the -LOGPARM setting with this additional parameter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My INFO message now appears before the wait period starts &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assuming no performance issues with our other programs, I will implement/promote this change to the shell script . . . thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Antony&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 15:13:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-force-updates-to-SAS-Log/m-p/414032#M101410</guid>
      <dc:creator>aknight1</dc:creator>
      <dc:date>2017-11-16T15:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to force updates to SAS Log?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-force-updates-to-SAS-Log/m-p/414473#M101551</link>
      <description>&lt;P&gt;Hopefully&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32246"&gt;@ChrisBrooks&lt;/a&gt;&amp;nbsp;solution works out for you, that's probably the best way to handle this.&amp;nbsp; If not though you can take an approach I've been using for the past several years, which is to output critical data to a separate log file that you control manually.&amp;nbsp; I initially developed a macro that uses the standard file commands (FILENAME, FOPEN, FPUT, FAPPEND, FCLOSE, etc) to write summary text out to a text file when I was working in a very locked down SAS environment, but since then I've found that the approach is incredibly useful even in an open environment.&amp;nbsp; Basically it lets you create a very concise log file with only the exact things you care about seeing in it.&amp;nbsp; I've found it especially useful when dealing with extremely long programs where I can monitor the progress a lot easier.&amp;nbsp; Recently I also modified my version of this code so that in addition to outputting data to a secondary log file, it also prints it's output directly to the command line so you can follow the progress of a batch program in real-time without even needing to open a separate file.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2017 17:00:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-force-updates-to-SAS-Log/m-p/414473#M101551</guid>
      <dc:creator>Sven111</dc:creator>
      <dc:date>2017-11-17T17:00:02Z</dc:date>
    </item>
  </channel>
</rss>

