<?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: proc optmodel in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/354810#M64139</link>
    <description>Ok. I will try it</description>
    <pubDate>Sun, 30 Apr 2017 13:57:39 GMT</pubDate>
    <dc:creator>asma1</dc:creator>
    <dc:date>2017-04-30T13:57:39Z</dc:date>
    <item>
      <title>proc optmodel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/352989#M64046</link>
      <description>Can I enter proc optomodel inside a loop</description>
      <pubDate>Mon, 24 Apr 2017 19:26:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/352989#M64046</guid>
      <dc:creator>asma1</dc:creator>
      <dc:date>2017-04-24T19:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: proc optmodel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/353103#M64052</link>
      <description>&lt;P&gt;I'm guessing that you mean proc optmodel. Yes you can, but why?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 06:05:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/353103#M64052</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-04-25T06:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: proc optmodel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/353132#M64053</link>
      <description>I want to make a simulation on the model results&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Tue, 25 Apr 2017 09:46:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/353132#M64053</guid>
      <dc:creator>asma1</dc:creator>
      <dc:date>2017-04-25T09:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: proc optmodel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/353134#M64054</link>
      <description>&lt;P&gt;You have to be more specific than this, otherwise it is imposible to help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you have already?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 09:51:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/353134#M64054</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-04-25T09:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: proc optmodel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/353156#M64055</link>
      <description>&lt;P&gt;For simulation and optimization, I recommend SAS/IML. It is easy to write a loop that simulates data, computes or optimizes some quantity, and stores the results. &amp;nbsp;search for your relevant terms at &lt;EM&gt;The DO Loop&lt;/EM&gt; blog. For example, search&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; optimize simulation site:blogs.sas.com/content/iml&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 12:16:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/353156#M64055</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-04-25T12:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: proc optmodel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/354810#M64139</link>
      <description>Ok. I will try it</description>
      <pubDate>Sun, 30 Apr 2017 13:57:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/354810#M64139</guid>
      <dc:creator>asma1</dc:creator>
      <dc:date>2017-04-30T13:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: proc optmodel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/354816#M64141</link>
      <description>Actually i generated normal data in proc iml and simulated this data twice as an example by do loops and then i used optmodel - milp to manupilate this data . After i finished proc optmodel how i can count some statistics on the result data . I used do loops inside the proc optmodel but it counts wrongly.&lt;BR /&gt;do o=1 to 2;&lt;BR /&gt;e=e+20;&lt;BR /&gt;do i=1 to 10;&lt;BR /&gt;e=e+1;&lt;BR /&gt;If (I1 [e] =0) &amp;amp; (I2[e]=1) then ss=ss+1;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;print ss;</description>
      <pubDate>Sun, 30 Apr 2017 15:23:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/354816#M64141</guid>
      <dc:creator>asma1</dc:creator>
      <dc:date>2017-04-30T15:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: proc optmodel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/354825#M64143</link>
      <description>&lt;P&gt;Please post your code so that we can help you. &amp;nbsp;Also, describe the problem you are trying to&amp;nbsp;solve.&lt;/P&gt;</description>
      <pubDate>Sun, 30 Apr 2017 18:38:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/354825#M64143</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-04-30T18:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: proc optmodel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/354988#M64157</link>
      <description>Please, why ss does not get a value?.&lt;BR /&gt;&lt;BR /&gt;DATA WORK.New_Text_Document;&lt;BR /&gt;LENGTH&lt;BR /&gt;F1 8&lt;BR /&gt;F2 8&lt;BR /&gt;F3 8&lt;BR /&gt;F4 8&lt;BR /&gt;F5 8 ;&lt;BR /&gt;FORMAT&lt;BR /&gt;F1 BEST1.&lt;BR /&gt;F2 BEST1.&lt;BR /&gt;F3 BEST1.&lt;BR /&gt;F4 BEST7.&lt;BR /&gt;F5 BEST8. ;&lt;BR /&gt;INFORMAT&lt;BR /&gt;F1 BEST1.&lt;BR /&gt;F2 BEST1.&lt;BR /&gt;F3 BEST1.&lt;BR /&gt;F4 BEST7.&lt;BR /&gt;F5 BEST8. ;&lt;BR /&gt;INFILE DATALINES4&lt;BR /&gt;DLM='7F'x&lt;BR /&gt;MISSOVER&lt;BR /&gt;DSD ;&lt;BR /&gt;INPUT&lt;BR /&gt;F1 : ?? BEST1.&lt;BR /&gt;F2 : ?? BEST1.&lt;BR /&gt;F3 : ?? BEST1.&lt;BR /&gt;F4 : ?? COMMA7.&lt;BR /&gt;F5 : ?? COMMA8. ;&lt;BR /&gt;DATALINES4;&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;9.36513&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;9.63096&amp;#127;0&lt;BR /&gt;1&amp;#127;0&amp;#127;0&amp;#127;8.31098&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;8.82035&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;9.02323&amp;#127;0&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;3.19215&amp;#127;0&lt;BR /&gt;1&amp;#127;0&amp;#127;0&amp;#127;7.67903&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;6.14234&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;8.02049&amp;#127;0&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;4.96575&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;9.03369&amp;#127;0&lt;BR /&gt;1&amp;#127;0&amp;#127;0&amp;#127;6.77483&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;7.47034&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;8.56158&amp;#127;0&lt;BR /&gt;1&amp;#127;0&amp;#127;0&amp;#127;8.06398&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;7.47483&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;7.8256&amp;#127;0&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;7.57218&amp;#127;0&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;7.08857&amp;#127;0&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;3.89241&amp;#127;0&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;0&amp;#127;11.66423&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;0&amp;#127;4.30379&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;0&amp;#127;0.37147&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;0&amp;#127;3.57818&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;0&amp;#127;4.88174&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;0.37593&amp;#127;0&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;0&amp;#127;11.08929&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;0.44449&amp;#127;0&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;0&amp;#127;20.29377&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;0&amp;#127;3.13584&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;8.11312&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;6.63839&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;3.28692&amp;#127;0&lt;BR /&gt;1&amp;#127;0&amp;#127;0&amp;#127;7.48911&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;9.55277&amp;#127;0&lt;BR /&gt;1&amp;#127;0&amp;#127;0&amp;#127;8.57312&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;9.37116&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;8.12482&amp;#127;0&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;5.90603&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;8.05699&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;9.41377&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;7.66217&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;9.21639&amp;#127;0&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;9.09599&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;8.04078&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;9.42247&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;9.25988&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;8.53722&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;7.3448&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;8.67279&amp;#127;0&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;0&amp;#127;0.23079&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;0&amp;#127;3.21347&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;0&amp;#127;4.45631&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;0&amp;#127;9.34735&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;2.52935&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;6.10898&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;4.9073&amp;#127;0&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;5.17446&amp;#127;0&lt;BR /&gt;0&amp;#127;1&amp;#127;0&amp;#127;0&amp;#127;1.27971&lt;BR /&gt;1&amp;#127;1&amp;#127;1&amp;#127;5.09162&amp;#127;0&lt;BR /&gt;;;;;&lt;BR /&gt;proc iml;&lt;BR /&gt;&lt;BR /&gt;use WORK.New_Text_Document;&lt;BR /&gt;read all var {F1 F2 F3 F4 F5 } into b;&lt;BR /&gt;print b;&lt;BR /&gt;i=0;&lt;BR /&gt;ss=0;&lt;BR /&gt;do i=21 to 30, 51 to 60;&lt;BR /&gt;If ( F1[i] =0) &amp;amp; (F2[i]=1) then ss=ss+1;&lt;BR /&gt;end;&lt;BR /&gt;print ss;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 01 May 2017 17:24:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/354988#M64157</guid>
      <dc:creator>asma1</dc:creator>
      <dc:date>2017-05-01T17:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: proc optmodel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/354997#M64159</link>
      <description>&lt;P&gt;The DO loop in SAS/IML does not support the comma syntax, thus the statement&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;do i=21 to 30, 51 to 60;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;is invalid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead, put those values into a vector and use vectorized subscript computations:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;idx = (21:30) || (51:60);&lt;BR /&gt;F1 = b[,1]; F2 = b[,2];
ss = sum( F1[idx]=0  &amp;amp; F2[idx]=1 );
print ss;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The vectorized computation is faster and simpler than the equivalent computation that uses loops:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* you could do this, but not efficient */&lt;BR /&gt;F1 = b[,1]; F2 = b[,2];
ss=0;
do i=21 to 30;
If ( F1[i] =0) &amp;amp; (F2[i]=1) then ss=ss+1;
end;
do i=51 to 60;
If ( F1[i] =0) &amp;amp; (F2[i]=1) then ss=ss+1;
end;
print ss;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, the data you posted seems to be corrupted. In the future please paste code into the SAS Code Window by clicking the "running&amp;nbsp;man icon" in the editor&amp;nbsp;while posting your question,&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 14:43:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/354997#M64159</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-05-02T14:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: proc optmodel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/355242#M64171</link>
      <description>I am Sorry, but I don't know where is the running man icon.&lt;BR /&gt;&lt;BR /&gt;I run the two methods, the first method gets error and this is the log.&lt;BR /&gt;NOTE: IML Ready&lt;BR /&gt;128&lt;BR /&gt;129 use WORK.New_Text_Document;&lt;BR /&gt;130 read all var {F1 F2 F3 F4 F5 } into b;&lt;BR /&gt;131 print b;&lt;BR /&gt;132 i=0;&lt;BR /&gt;133 ss=0;&lt;BR /&gt;134 /*do i=21 to 30;&lt;BR /&gt;135 if (F1 [i] =0 &amp;amp; F2[i]=1 then ss=ss+1;&lt;BR /&gt;136 end;&lt;BR /&gt;137 do i=51 to 60;&lt;BR /&gt;138 if (F1 [i] =0 &amp;amp; F2[i]=1 then ss=ss+1;&lt;BR /&gt;139 end;&lt;BR /&gt;140 print ss;*/&lt;BR /&gt;141 i=(21:30)||(41:50);&lt;BR /&gt;142 ss=sum(F1 [i] =0 &amp;amp; F2[i]=1);&lt;BR /&gt;ERROR: (execution) Matrix has not been set to a value.&lt;BR /&gt;&lt;BR /&gt;operation : [ at line 142 column 11&lt;BR /&gt;operands : F1, i&lt;BR /&gt;&lt;BR /&gt;Also,The second method by do loops gets error in the log&lt;BR /&gt;&lt;BR /&gt;NOTE: IML Ready&lt;BR /&gt;&lt;BR /&gt;129 use WORK.New_Text_Document;&lt;BR /&gt;130 read all var {F1 F2 F3 F4 F5 } into b;&lt;BR /&gt;131 print b;&lt;BR /&gt;132 ss=0;&lt;BR /&gt;133 do i=21 to 30;&lt;BR /&gt;134 if (F1 [i] =0 &amp;amp; F2[i]=1 then ss=ss+1;&lt;BR /&gt;____&lt;BR /&gt;79&lt;BR /&gt;ERROR 79-322: Expecting a ).&lt;BR /&gt;&lt;BR /&gt;135 end;&lt;BR /&gt;ERROR: END does not occur within DO group at line=135 col=1.&lt;BR /&gt;The last thing, I run this program on 2 intervals of data. What if I have&lt;BR /&gt;large data and I want to run for many intervals of data (which are&lt;BR /&gt;systematic intervals). For example, after 20 observations, I choose 10&lt;BR /&gt;observations and so on. How I can do that?&lt;BR /&gt;THANKS,&lt;BR /&gt;&lt;BR /&gt;Show quoted text</description>
      <pubDate>Tue, 02 May 2017 13:36:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/355242#M64171</guid>
      <dc:creator>asma1</dc:creator>
      <dc:date>2017-05-02T13:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: proc optmodel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/355271#M64173</link>
      <description>&lt;P&gt;1. The running man icon looks like this:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8660iBCD1F24C2421C376/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Region Capture.png" title="Region Capture.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Sorry, I didn't realize you had read the variables into the matrix B. &amp;nbsp;I have edited&amp;nbsp;my previous answer to add the line&lt;/P&gt;
&lt;P&gt;F1 = b[,1]; F2 = b[,2];&lt;/P&gt;
&lt;P&gt;which extracts the first column of B into the vector F1 and the second column into the vector F2.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 14:47:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-optmodel/m-p/355271#M64173</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-05-02T14:47:35Z</dc:date>
    </item>
  </channel>
</rss>

