<?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 Do loop Output in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-loop-Output/m-p/86143#M503</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want&amp;nbsp; show,&amp;nbsp; before ending DO loop ,the observation N and the vector P&amp;nbsp; for any i value in data_set&lt;/P&gt;&lt;P&gt;in this proc IML :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc iml;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M_NP ={1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6};&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;P= j(1000,1,.);&lt;BR /&gt;j=0;&lt;BR /&gt;do i=1 to 5;&lt;/P&gt;&lt;P&gt; n= round((M_NP[i+1]-M_NP&lt;I&gt;)* 100);&lt;BR /&gt; U= j(n,1,.);&lt;BR /&gt; call randgen(U,"uniform");&lt;BR /&gt; P[j+1:j+n]= M_NP&lt;I&gt;+(M_NP[i+1]-M_NP&lt;I&gt;)* U;&lt;BR /&gt; j=j+n;&lt;BR /&gt;end;&lt;BR /&gt;quit;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Jun 2012 17:03:19 GMT</pubDate>
    <dc:creator>nannà</dc:creator>
    <dc:date>2012-06-18T17:03:19Z</dc:date>
    <item>
      <title>Do loop Output</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-loop-Output/m-p/86143#M503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want&amp;nbsp; show,&amp;nbsp; before ending DO loop ,the observation N and the vector P&amp;nbsp; for any i value in data_set&lt;/P&gt;&lt;P&gt;in this proc IML :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc iml;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M_NP ={1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6};&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;P= j(1000,1,.);&lt;BR /&gt;j=0;&lt;BR /&gt;do i=1 to 5;&lt;/P&gt;&lt;P&gt; n= round((M_NP[i+1]-M_NP&lt;I&gt;)* 100);&lt;BR /&gt; U= j(n,1,.);&lt;BR /&gt; call randgen(U,"uniform");&lt;BR /&gt; P[j+1:j+n]= M_NP&lt;I&gt;+(M_NP[i+1]-M_NP&lt;I&gt;)* U;&lt;BR /&gt; j=j+n;&lt;BR /&gt;end;&lt;BR /&gt;quit;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 17:03:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-loop-Output/m-p/86143#M503</guid>
      <dc:creator>nannà</dc:creator>
      <dc:date>2012-06-18T17:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Do loop Output</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-loop-Output/m-p/86144#M504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to print N and P for each iteration, use&lt;/P&gt;&lt;P&gt;print i N P;&lt;/P&gt;&lt;P&gt;Since P has 1,000 rows, this is a lot of printing of mostly missing values. You could also say&lt;/P&gt;&lt;P&gt;print i N (P[j+1:j+n])[label="P"];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 17:27:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-loop-Output/m-p/86144#M504</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2012-06-18T17:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Do loop Output</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-loop-Output/m-p/86145#M505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="short_text" id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;thank you very much...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;but &lt;/SPAN&gt;&lt;/SPAN&gt;If i want show N and P for each iteration in &lt;SPAN style="text-decoration: underline;"&gt;data set&lt;/SPAN&gt;&amp;nbsp; (the print in output is too long),&lt;/P&gt;&lt;P&gt;how do I do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 17:34:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-loop-Output/m-p/86145#M505</guid>
      <dc:creator>nannà</dc:creator>
      <dc:date>2012-06-18T17:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Do loop Output</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-loop-Output/m-p/86146#M506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You want to create a data set that contains N and P during the loop?&lt;/P&gt;&lt;P&gt;Use the CREATE and APPEND statments like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 14pt;"&gt;create &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;Out &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 14pt;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt; {N Pi};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 14pt;"&gt;do &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;i=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 14pt;"&gt;to&lt;/SPAN&gt; &lt;STRONG style="color: teal; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;5&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;n= round((M_NP[i+&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;]-M_NP&lt;I&gt;)*&lt;STRONG style="color: teal; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;100&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;);&lt;/SPAN&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;U= j(n,&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;,&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;.&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 14pt;"&gt;call &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;randgen(U,&lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 14pt;"&gt;"uniform"&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;&amp;nbsp;&amp;nbsp; P&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;i = M_NP&lt;I&gt;+(M_NP[i+&lt;/I&gt;&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;]-M_NP&lt;I&gt;)*U;&lt;/I&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 14pt;"&gt;append&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 14pt;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 14pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; line-height: 115%; font-family: 'Courier New'; font-size: 14pt;"&gt;close&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; line-height: 115%; font-family: 'Courier New'; font-size: 14pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2012 14:39:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-loop-Output/m-p/86146#M506</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2012-06-22T14:39:15Z</dc:date>
    </item>
  </channel>
</rss>

