<?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 route the sas iml log into an external file in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/route-the-sas-iml-log-into-an-external-file/m-p/260011#M2648</link>
    <description>&lt;P&gt;Hi, I want to route the log generated by SAS IML to an external file. I have a loop to execute and I want to route the log of each loop to a different file. I have used proc printto procedure in combination with submit and endsubmit statement to execute the procedure inside SAS IML. However the result I got is empty log file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;proc&amp;nbsp;iml;&lt;/P&gt;
&lt;P&gt;do i=1 to 7;&lt;/P&gt;
&lt;P&gt;submit i;&lt;/P&gt;
&lt;P&gt;proc printto log="D:\SAS generated files\log &amp;amp;i.log" new;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;endsubmit;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Mar 2016 09:21:26 GMT</pubDate>
    <dc:creator>Hanyu</dc:creator>
    <dc:date>2016-03-30T09:21:26Z</dc:date>
    <item>
      <title>route the sas iml log into an external file</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/route-the-sas-iml-log-into-an-external-file/m-p/260011#M2648</link>
      <description>&lt;P&gt;Hi, I want to route the log generated by SAS IML to an external file. I have a loop to execute and I want to route the log of each loop to a different file. I have used proc printto procedure in combination with submit and endsubmit statement to execute the procedure inside SAS IML. However the result I got is empty log file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;proc&amp;nbsp;iml;&lt;/P&gt;
&lt;P&gt;do i=1 to 7;&lt;/P&gt;
&lt;P&gt;submit i;&lt;/P&gt;
&lt;P&gt;proc printto log="D:\SAS generated files\log &amp;amp;i.log" new;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;endsubmit;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 09:21:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/route-the-sas-iml-log-into-an-external-file/m-p/260011#M2648</guid>
      <dc:creator>Hanyu</dc:creator>
      <dc:date>2016-03-30T09:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: route the sas iml log into an external file</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/route-the-sas-iml-log-into-an-external-file/m-p/260090#M2649</link>
      <description>&lt;P&gt;Could you give us some context and tell us what you are trying to accomplish? In other words, what are you trying to do statistically/numerically that you think will become easier if you can redirect the Log?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 14:02:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/route-the-sas-iml-log-into-an-external-file/m-p/260090#M2649</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-03-30T14:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: route the sas iml log into an external file</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/route-the-sas-iml-log-into-an-external-file/m-p/260099#M2650</link>
      <description>Hi Rick. I have a long time series of bond price and I am trying to compute&lt;BR /&gt;the yield to maturity by mininizing the distance between the discounted&lt;BR /&gt;coupon value and par value and the quoted dirty bond price. Therefore I&lt;BR /&gt;need to do a lot of optimisation for each bond price. Some of the&lt;BR /&gt;optimisation cannot converge probably because I cannot manually try&lt;BR /&gt;different starting values; There are too many bond prices. I want to&lt;BR /&gt;analyze the log file each time I try a different starting value for the&lt;BR /&gt;entire series to see which starting value generate the least amount of no&lt;BR /&gt;convergence.&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Wed, 30 Mar 2016 14:10:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/route-the-sas-iml-log-into-an-external-file/m-p/260099#M2650</guid>
      <dc:creator>Hanyu</dc:creator>
      <dc:date>2016-03-30T14:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: route the sas iml log into an external file</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/route-the-sas-iml-log-into-an-external-file/m-p/260116#M2651</link>
      <description>&lt;P&gt;OK. I assume that you are using a built-in NLP routine (such as NLPNRA) to compute each optimization.&amp;nbsp; The first argument to an NLP function is a return code (rc). So your call looks like this:&lt;/P&gt;
&lt;P&gt;call nlpnra(rc, result, "ObjectiveFunc", InitGuess, options);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When the function returns, &lt;A href="http://support.sas.com/documentation/cdl/en/imlug/66845/HTML/default/viewer.htm#imlug_nonlinearoptexpls_sect009.htm" target="_self"&gt;the value of the return code&lt;/A&gt;&amp;nbsp;will be positive if the optimization converged and negative if the optimization did not converge.&amp;nbsp; Therefore you can save the value of&amp;nbsp;each return code and examine them later, together with the initial guess.&amp;nbsp; Here's some pseudocode to get you started:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
...
convergence = j(100,1,.);
initialGuess = j(100, numParams);
do i = 1 to 100;
   /* set i_th guess from file or randomly or systematically */
   initGuess = T( randfun(NumParams, "Normal") );
   call nlpnra(rc, result, "ObjectiveFunc", InitGuess, options);
   /* save the initial guess and the return code */
   convergence[i] = rc;
   initialGuess[i,] = initGuess;
end;

/* now analyze relationship between convergence and initial guess */
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might be interested in reading this article about &lt;A href="http://blogs.sas.com/content/iml/2014/06/11/initial-guess-for-optimization.html" target="_self"&gt;how to choose a good starting guess for an optimization.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 14:32:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/route-the-sas-iml-log-into-an-external-file/m-p/260116#M2651</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-03-30T14:32:38Z</dc:date>
    </item>
  </channel>
</rss>

