<?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 proc and the checking of the matrix element as a probability in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-proc-and-the-checking-of-the-matrix-element-as-a-probability/m-p/275212#M2821</link>
    <description>&lt;PRE&gt;
What do you mean by "without coding" ?



proc iml;
x={1.1 0.9,0.7 1.2};
if any(x&amp;gt;1 | x&amp;lt;0) then abort;
 else print 'Good';
quit;


&lt;/PRE&gt;</description>
    <pubDate>Sun, 05 Jun 2016 02:56:52 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-06-05T02:56:52Z</dc:date>
    <item>
      <title>IML proc and the checking of the matrix element as a probability</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-proc-and-the-checking-of-the-matrix-element-as-a-probability/m-p/275169#M2820</link>
      <description>&lt;P&gt;Hello Expert,&lt;/P&gt;
&lt;P&gt;When we use IML PROC to calcule a matrix element (Mij) as a probabilty, So Mij will respect this condition.&lt;/P&gt;
&lt;P&gt;0&amp;lt;=Mij&amp;lt;=1.&lt;/P&gt;
&lt;P&gt;Please, Is there any method - without coding-&amp;nbsp; to transfore Mij&amp;lt;0 or Mij&amp;gt;1 as error and stop the treatement ?&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jun 2016 08:36:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-proc-and-the-checking-of-the-matrix-element-as-a-probability/m-p/275169#M2820</guid>
      <dc:creator>LineMoon</dc:creator>
      <dc:date>2016-06-04T08:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: IML proc and the checking of the matrix element as a probability</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-proc-and-the-checking-of-the-matrix-element-as-a-probability/m-p/275212#M2821</link>
      <description>&lt;PRE&gt;
What do you mean by "without coding" ?



proc iml;
x={1.1 0.9,0.7 1.2};
if any(x&amp;gt;1 | x&amp;lt;0) then abort;
 else print 'Good';
quit;


&lt;/PRE&gt;</description>
      <pubDate>Sun, 05 Jun 2016 02:56:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-proc-and-the-checking-of-the-matrix-element-as-a-probability/m-p/275212#M2821</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-06-05T02:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: IML proc and the checking of the matrix element as a probability</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-proc-and-the-checking-of-the-matrix-element-as-a-probability/m-p/275234#M2822</link>
      <description>&lt;P&gt;Thank you very much&lt;/P&gt;
&lt;P&gt;What's I mean by "without coding" ?&lt;/P&gt;
&lt;P&gt;Your answer is correct. But in some cases, we can have so many programs without your check&lt;/P&gt;
&lt;PRE&gt;if any(x&amp;gt;1 | x&amp;lt;0) then abort;&lt;/PRE&gt;
&lt;P&gt;In this case, we must have to code "if any(x&amp;gt;1 | x&amp;lt;0)&amp;nbsp; then abort" in every program.&lt;/P&gt;
&lt;P&gt;So, I am looking for some global option- if exist- to do the check without coding the condition in every Matrix.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jun 2016 08:47:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-proc-and-the-checking-of-the-matrix-element-as-a-probability/m-p/275234#M2822</guid>
      <dc:creator>LineMoon</dc:creator>
      <dc:date>2016-06-05T08:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: IML proc and the checking of the matrix element as a probability</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-proc-and-the-checking-of-the-matrix-element-as-a-probability/m-p/275291#M2825</link>
      <description>&lt;P&gt;No. You can't . SAS&amp;nbsp;unlike Jave or other Object-Orientation Language.&lt;/P&gt;
&lt;P&gt;SAS can't create a brand-new CLASS ,can't overwrite/overload a CLASS. therefore you can't create a special Object(Matrix).&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2016 02:57:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-proc-and-the-checking-of-the-matrix-element-as-a-probability/m-p/275291#M2825</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-06-06T02:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: IML proc and the checking of the matrix element as a probability</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-proc-and-the-checking-of-the-matrix-element-as-a-probability/m-p/275483#M2831</link>
      <description>&lt;P&gt;This is a classic use case for a macro, which performs text substitution. Define a macro such as&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro CheckProb(m);
   if any(&amp;amp;m&amp;gt;1 | &amp;amp;m&amp;lt;0) then abort "Matrix &amp;amp;m out of range";
   else;
%mend;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then any time you want to check whether a matrix has elements outside of [0,1] just insert the macro call, like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
x={1.1 0.9,0.7 1.2};
%CheckProb(x)
/* continue the program */&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Jun 2016 18:01:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-proc-and-the-checking-of-the-matrix-element-as-a-probability/m-p/275483#M2831</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-06-06T18:01:20Z</dc:date>
    </item>
  </channel>
</rss>

