<?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: IML if-then in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-if-then/m-p/453607#M4123</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I posted the code in the attachment,&lt;BR /&gt;I'm not sure of the last part of the macro code.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I don't know how to code for this part.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;- if pe&amp;lt;0.05 then l = l-1&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;if ps &amp;lt;0.05 then m = m + 1&amp;nbsp; , and pe and ps must be calculated until both pe and ps are greater than 0.05..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Apr 2018 15:25:36 GMT</pubDate>
    <dc:creator>shkim</dc:creator>
    <dc:date>2018-04-12T15:25:36Z</dc:date>
    <item>
      <title>IML if-then</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-if-then/m-p/453597#M4121</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have already&amp;nbsp;complete macro program code that computes pe and ps. (Attachments: macro test)&lt;BR /&gt;but i don't know how to code&lt;/P&gt;&lt;P&gt;when&amp;nbsp; , if pe &amp;lt; 0.05 then&amp;nbsp;I = l-1, if ps &amp;lt; 0.05 then m = m + 1, and pe and ps must be repeated until both are greater than 0.05.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**ex data**&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc iml;&lt;BR /&gt;ze_0={1,2,3};&lt;BR /&gt;zs_0{1,3,5};&lt;BR /&gt;ze_1={2,3,4};&lt;BR /&gt;zs_1={2,4,2};&lt;BR /&gt;ze_2={1,3,2};&lt;BR /&gt;zs_2={2,5,4};&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pe=#{max(ze_i[l,1],zs_i[m,1])&amp;gt;=ze_0[l,1]}/nb&lt;BR /&gt;ps=#{max(zs_i[l,1],zs_i[m,1])&amp;gt;=zs_0[m,1]}/nb&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;l=3 to 1;&lt;/P&gt;&lt;P&gt;m=1 to 3;&lt;/P&gt;&lt;P&gt;i=1,2&lt;BR /&gt;nb=2;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 15:04:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-if-then/m-p/453597#M4121</guid>
      <dc:creator>shkim</dc:creator>
      <dc:date>2018-04-12T15:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: IML if-then</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-if-then/m-p/453602#M4122</link>
      <description>&lt;P&gt;IF statements in IML work the same as IF statements anywhere else. So it's not clear to me exactly what your problem is. Can you be much more specific?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 15:14:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-if-then/m-p/453602#M4122</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-04-12T15:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: IML if-then</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-if-then/m-p/453607#M4123</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I posted the code in the attachment,&lt;BR /&gt;I'm not sure of the last part of the macro code.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I don't know how to code for this part.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;- if pe&amp;lt;0.05 then l = l-1&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;if ps &amp;lt;0.05 then m = m + 1&amp;nbsp; , and pe and ps must be calculated until both pe and ps are greater than 0.05..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 15:25:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-if-then/m-p/453607#M4123</guid>
      <dc:creator>shkim</dc:creator>
      <dc:date>2018-04-12T15:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: IML if-then</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-if-then/m-p/453613#M4124</link>
      <description>&lt;P&gt;And what happens when you execute this code?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Show us the SASLOG of the relevant parts. Use the {i} button and paste the SASLOG of the relevant parts into the {i} window.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 15:32:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-if-then/m-p/453613#M4124</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-04-12T15:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: IML if-then</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-if-then/m-p/453646#M4125</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ze_0;
input COL1 @@;
cards;
  0.16013 
  0.32026 
  0.80064 
  0.64051 
  0.64051 

run;

data zs_0;
input COL1 @@;
cards;
-0.16013
-0.48038
0.32026
0.48038
0.80064
run;

data ze_1;
input COL1 @@;
cards;
-0.16013
-0.16013
-0.16013
0.00000
0.32026
run;

data zs_1;
input COL1 @@;
cards;
-0.64051
-1.28103
-0.80064
-0.80064
-0.32026
run;

data ze_2;
input COL1 @@;
cards;
1.92154
2.40192
2.40192
0.96077
1.92154
run;

data zs_2;
input COL1 @@;
cards;
1.60128
1.44115
0.48038
1.12090
2.08167
run;

data ze_3;
input COL1 @@;
cards;
0.32026
1.44115
1.76141
1.76141
2.08167
run;

data zs_3;
input COL1 @@;
cards;
0.16013
-1.44115
-0.16013
-0.48038
0.32026
run;

data ze_4;
input COL1 @@;
cards;
0.00000
0.00000
0.96077
0.64051
0.64051
run;

data zs_4;
input COL1 @@;
cards;
-0.80064
-1.60128
-1.12090
-1.60128
-0.64051
run;

data ze_5;
input COL1 @@;
cards;
-1.28103
-0.80064
-0.48038
-0.64051
-0.96077
run;

data zs_5;
input COL1 @@;
cards;
-1.60128
-0.48038
0.48038
0.48038
0.16013
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When you run this data set and attachment macros (new attachments)&lt;BR /&gt;There is no error, but the desired result is different.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;% let l = 5;&lt;BR /&gt;% let m = 1;&lt;BR /&gt;% test (nb = 5, l = &amp;amp; l, m = &amp;amp; m);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is result in&amp;nbsp;pe = 0.6 ps = 0.8.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since pe &amp;lt; 0.7,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next is&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;% let l = 4; % let m = 1; % test (nb = 5, l = &amp;amp; l, m = &amp;amp; m);&lt;BR /&gt;This should be done.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With such a routine, when l = 3 and m = 1, pe and ps are both greater than 0.7 for the first time.&lt;/P&gt;&lt;P&gt;However, if the macro aaa is executed, the value of l = 4 and m = 2 appears, so i don't know why the value is wrong.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 16:36:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-if-then/m-p/453646#M4125</guid>
      <dc:creator>shkim</dc:creator>
      <dc:date>2018-04-12T16:36:28Z</dc:date>
    </item>
  </channel>
</rss>

