<?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 Monitor the Do Loop Process in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Monitor-the-Do-Loop-Process/m-p/87300#M520</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I want to monitor the loop process to know to what extent has the loop finished. For example, I have to do a 10000 times loop, and the approximately time is around 5~8 hours, I want to periodically check&amp;nbsp; how many times has the loop finished. I see the blog posted by Rick Wicklin "Using the MOD function as a debugging tool", &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc iml;&lt;/P&gt;&lt;P&gt;do i = 1 to 100;&lt;/P&gt;&lt;P&gt;&amp;nbsp; x = sum(1:i);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if mod(i,10)=0 then do; /* print every 10 iterations */&lt;/P&gt;&lt;P&gt;&amp;nbsp; print i x;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to do something like that, but the problem is that it only prints i and x after it is entirely finished. Is there any method which can print the i periodically during the processing?&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 May 2013 09:30:54 GMT</pubDate>
    <dc:creator>MichaelGong</dc:creator>
    <dc:date>2013-05-28T09:30:54Z</dc:date>
    <item>
      <title>Monitor the Do Loop Process</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Monitor-the-Do-Loop-Process/m-p/87300#M520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I want to monitor the loop process to know to what extent has the loop finished. For example, I have to do a 10000 times loop, and the approximately time is around 5~8 hours, I want to periodically check&amp;nbsp; how many times has the loop finished. I see the blog posted by Rick Wicklin "Using the MOD function as a debugging tool", &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc iml;&lt;/P&gt;&lt;P&gt;do i = 1 to 100;&lt;/P&gt;&lt;P&gt;&amp;nbsp; x = sum(1:i);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if mod(i,10)=0 then do; /* print every 10 iterations */&lt;/P&gt;&lt;P&gt;&amp;nbsp; print i x;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to do something like that, but the problem is that it only prints i and x after it is entirely finished. Is there any method which can print the i periodically during the processing?&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 09:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Monitor-the-Do-Loop-Process/m-p/87300#M520</guid>
      <dc:creator>MichaelGong</dc:creator>
      <dc:date>2013-05-28T09:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor the Do Loop Process</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Monitor-the-Do-Loop-Process/m-p/87301#M521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure that PROC IML ". . . only prints i and x after it is entirely finished"?&amp;nbsp; The example given would be expected to run very quickly so that it may only seem as if PROC IML prints the results only after it is entirely finished.&amp;nbsp; If your own example that loops 10,000 times takes 5 hours [=300 minutes = 18,000 seconds] to complete, each loop takes an average of about 1.8 seconds to complete.&amp;nbsp; Using MOD(i,10) would print after each 10 loops or 18 seconds, which you should be able to monitor by viewing the SAS output; bump it up to MOD(i, 100) to view this output every 3 minutes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 12:42:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Monitor-the-Do-Loop-Process/m-p/87301#M521</guid>
      <dc:creator>1zmm</dc:creator>
      <dc:date>2013-05-28T12:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor the Do Loop Process</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Monitor-the-Do-Loop-Process/m-p/87302#M522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know of an easy way to do this in PROC IML for the ODS output destinations. It's not just the DO loop that is causing this. When you submit a block of statements, the ODS system buffers up the output displays the output when the computations finish. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the SAS/IML Studio application you can do this by using the PRINTNOW statement: &lt;A class="active_link" href="http://support.sas.com/documentation/onlinedoc/imlstudio/WebHelp/the_imlplus_language/iml_language_extensions/the_printnow_statement.htm" title="http://support.sas.com/documentation/onlinedoc/imlstudio/WebHelp/the_imlplus_language/iml_language_extensions/the_printnow_statement.htm"&gt;The PRINTNOW Statement&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a work-around that might be helpful. If you only want to print out scalar quantities, you can use the PUT statement to output scalar quantities to the SAS Log.&amp;nbsp; This should suffice for printing an iteration number:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc iml;&lt;BR /&gt;start Report; /* print status to SAS Log */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; file log;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; put i x;&amp;nbsp; /* works only for scalar values */&lt;BR /&gt;finish;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do i = 1 to 10;&lt;BR /&gt;&amp;nbsp; x = sum(1:i);&lt;BR /&gt;&amp;nbsp; if mod(i,2)=0 then do; /* print every 2 iterations */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run Report;&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp; call sleep(0.5,1); /* wait for 0.5 seconds */&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;print i x;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 12:50:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Monitor-the-Do-Loop-Process/m-p/87302#M522</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2013-05-28T12:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor the Do Loop Process</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Monitor-the-Do-Loop-Process/m-p/87303#M523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The OP is correct.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 12:50:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Monitor-the-Do-Loop-Process/m-p/87303#M523</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2013-05-28T12:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor the Do Loop Process</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Monitor-the-Do-Loop-Process/m-p/87304#M524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I remember writing a program a long time ago (I think I was working on a DEC Alpha with SAS 6 or 7), that used call push() and then a window statement to report monitoring stats when the user interrupted the program.&amp;nbsp;&amp;nbsp; Could something like that still work, or has the advent of ODS changed things?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 14:27:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Monitor-the-Do-Loop-Process/m-p/87304#M524</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2013-05-29T14:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor the Do Loop Process</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Monitor-the-Do-Loop-Process/m-p/87305#M525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can still PAUSE and ask the user to continue:&lt;/P&gt;&lt;P&gt;PAUSE "Submit 'RESUME;' to continue";&lt;/P&gt;&lt;P&gt;That will flush the output buffer. However, I assumed the OP wanted a continuous monitor process that does not wait for human input.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 14:37:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Monitor-the-Do-Loop-Process/m-p/87305#M525</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2013-05-29T14:37:55Z</dc:date>
    </item>
  </channel>
</rss>

