<?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 'IF-THEN' using IML in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IF-THEN-using-IML/m-p/245262#M2556</link>
    <description>&lt;P&gt;I am using if-then statements in a program I am running.&amp;nbsp; I have successfully run the program using data step processing, and am now trying an alternative method using proc iml.&amp;nbsp; However, the if-then statements are not working as they should when using IML.&amp;nbsp; I do not recieve error messages in the log, but the results are not what they should be.&amp;nbsp; Does proc iml require different language when using 'if-then' statements?&amp;nbsp; Below is the code I am referring to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if 0 &amp;lt;= yg &amp;lt; 2 then YG_SCS= YG1_Avg;&lt;BR /&gt;if 2 &amp;lt;= yg &amp;lt; 2.5 then YG_SCS = YG2_Avg;&lt;BR /&gt;if 2.5 &amp;lt;= yg &amp;lt; 3 then YG_SCS = YG2A_Avg;&lt;BR /&gt;if 3 &amp;lt;= yg &amp;lt; 4 then YG_SCS = YG3_Avg;&lt;BR /&gt;if 4 &amp;lt;= yg &amp;lt; 5 then YG_SCS = YG4_Avg;&lt;BR /&gt;else if yg &amp;gt;= 5 then YG_SCS =YG5_Avg;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jan 2016 18:51:04 GMT</pubDate>
    <dc:creator>kochsner</dc:creator>
    <dc:date>2016-01-21T18:51:04Z</dc:date>
    <item>
      <title>'IF-THEN' using IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IF-THEN-using-IML/m-p/245262#M2556</link>
      <description>&lt;P&gt;I am using if-then statements in a program I am running.&amp;nbsp; I have successfully run the program using data step processing, and am now trying an alternative method using proc iml.&amp;nbsp; However, the if-then statements are not working as they should when using IML.&amp;nbsp; I do not recieve error messages in the log, but the results are not what they should be.&amp;nbsp; Does proc iml require different language when using 'if-then' statements?&amp;nbsp; Below is the code I am referring to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if 0 &amp;lt;= yg &amp;lt; 2 then YG_SCS= YG1_Avg;&lt;BR /&gt;if 2 &amp;lt;= yg &amp;lt; 2.5 then YG_SCS = YG2_Avg;&lt;BR /&gt;if 2.5 &amp;lt;= yg &amp;lt; 3 then YG_SCS = YG2A_Avg;&lt;BR /&gt;if 3 &amp;lt;= yg &amp;lt; 4 then YG_SCS = YG3_Avg;&lt;BR /&gt;if 4 &amp;lt;= yg &amp;lt; 5 then YG_SCS = YG4_Avg;&lt;BR /&gt;else if yg &amp;gt;= 5 then YG_SCS =YG5_Avg;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 18:51:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IF-THEN-using-IML/m-p/245262#M2556</guid>
      <dc:creator>kochsner</dc:creator>
      <dc:date>2016-01-21T18:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: 'IF-THEN' using IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IF-THEN-using-IML/m-p/245268#M2557</link>
      <description>&lt;P&gt;The DATA step supports the ternary operator that you mention. This is called the "implied AND operator."&amp;nbsp; In other languages, including SAS/IML, you need to use an explicit operator to obtain the result you want. For details, explanation, and the IML syntax, see the article&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2012/02/20/the-data-step-and-the-implied-and-operator.html" target="_self"&gt;"The DATA step and the implied AND operator."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The article concludes:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Don't use the DATA step syntax in your SAS/IML programs. Instead, use an explicit AND operator such as &lt;TT&gt;(-2&amp;lt;x &amp;amp; x&amp;lt;2)&lt;/TT&gt;.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 19:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IF-THEN-using-IML/m-p/245268#M2557</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-01-21T19:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: 'IF-THEN' using IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IF-THEN-using-IML/m-p/246195#M2558</link>
      <description>&lt;P&gt;Do you have additional questions? If not, please mark this questions as solved so that others know that it has been answered.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 19:20:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IF-THEN-using-IML/m-p/246195#M2558</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-01-26T19:20:39Z</dc:date>
    </item>
  </channel>
</rss>

