<?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: Multiple Numeric Comparisons in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-Numeric-Comparisons/m-p/68186#M6798</link>
    <description>I don't know why line 9 of the original posting is differnt once posted.  In my code to use the characters to represent "greater than or Equal to" and "less than or equal to" - I don't spell it out in my codes.  I just don't know why this forum deletes them from my codes below.&lt;BR /&gt;
&lt;BR /&gt;
Here is what I would like for SAS EG to return one of the three performance:&lt;BR /&gt;
&lt;BR /&gt;
*if WeightedAvg_NCL Less Than or Equal to Standard_NCL and ApprovalRate Greater Than or Equal to Standard_ApprovalRate then de='effective';&lt;BR /&gt;
&lt;BR /&gt;
*if WeightedAvg_NCL &amp;gt; Standard_NCL and ApprovalRate &amp;lt; Standard_ApprovalRate then de='ineffective';&lt;BR /&gt;
&lt;BR /&gt;
*if WeightedAvg_NCL = Standard_NCL and ApprovalRate = Standard_ApprovalRate then de='meet'&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks again!&lt;BR /&gt;
&lt;BR /&gt;
****************&lt;BR /&gt;
3          PROC SQL NOEXEC;&lt;BR /&gt;
4             SELECT t1.WeightedAvg_NCL,&lt;BR /&gt;
5                    t1.ApprovalRate,&lt;BR /&gt;
6                    t2.Standard_NCL,&lt;BR /&gt;
7                    t2.Standard_ApprovalRate,&lt;BR /&gt;
8                    /* Decision Effectivness */&lt;BR /&gt;
9                      (if WeightedAvg_NCL &amp;lt;= Standard_NCL and ApprovalRate &amp;gt;= Standard_ApprovalRate then de='effective';&lt;BR /&gt;
                           _______________&lt;BR /&gt;
                           22&lt;BR /&gt;
                           76&lt;BR /&gt;
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, (, *, **, +, -, '.', /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, AND, EQ, EQT, &lt;BR /&gt;
              GE, GET, GT, GTT, LE, LET, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.  &lt;BR /&gt;
&lt;BR /&gt;
ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;
&lt;BR /&gt;
9                                                                                                                         if&lt;BR /&gt;
                                                                                                                          __&lt;BR /&gt;
                                                                                                                          180&lt;BR /&gt;
ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;
&lt;BR /&gt;
10                      WeightedAvg_NCL &amp;gt; Standard_NCL and ApprovalRate &amp;lt; Standard_ApprovalRate then de='ineffective';&lt;BR /&gt;
10       !                                                                                                            ) AS&lt;BR /&gt;
                                                                                                                      _&lt;BR /&gt;
                                                                                                                      180&lt;BR /&gt;
ERROR 180-322: Statement is not valid or it is used out of proper order.</description>
    <pubDate>Sat, 21 May 2011 23:50:25 GMT</pubDate>
    <dc:creator>jen123</dc:creator>
    <dc:date>2011-05-21T23:50:25Z</dc:date>
    <item>
      <title>Multiple Numeric Comparisons</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-Numeric-Comparisons/m-p/68185#M6797</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I have a situation where I need to calculate a performance based on 2 criteria.  Below is what I have attempted in EG - but it errored.&lt;BR /&gt;
&lt;BR /&gt;
The 1st 2 criterias are from one table, and the last 2 are from another table.  There is no common column/field between the 2 tables - so I did not join them.&lt;BR /&gt;
&lt;BR /&gt;
If the employee meets the two conditions, s/he is considered "EFFECTIVE".&lt;BR /&gt;
&lt;BR /&gt;
Please advise how I should fix this.  Thanks much!&lt;BR /&gt;
&lt;BR /&gt;
***************&lt;BR /&gt;
&lt;BR /&gt;
          PROC SQL NOEXEC;&lt;BR /&gt;
4             SELECT t1.WeightedAvg_NCL,&lt;BR /&gt;
5                    t1.ApprovalRate,&lt;BR /&gt;
6                    t2.Standard_NCL,&lt;BR /&gt;
7                    t2.Standard_ApprovalRate,&lt;BR /&gt;
8                    /* DecisionEffectiveness */&lt;BR /&gt;
9                      (if WeightedAvg_NCL &amp;lt;= Standard_NCL and ApprovalRate &amp;gt;= Standard_ApprovalRate then de='effective';&lt;BR /&gt;
                           _______________&lt;BR /&gt;
                           22&lt;BR /&gt;
                           76&lt;BR /&gt;
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, (, *, **, +, -, '.', /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, AND, EQ, EQT, &lt;BR /&gt;
              GE, GET, GT, GTT, LE, LET, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.  &lt;BR /&gt;
&lt;BR /&gt;
ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;
&lt;BR /&gt;
9                                                                                                                        ) AS&lt;BR /&gt;
                                                                                                                         _&lt;BR /&gt;
                                                                                                                         180&lt;BR /&gt;
ERROR 180-322: Statement is not valid or it is used out of proper order.</description>
      <pubDate>Sat, 21 May 2011 23:22:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-Numeric-Comparisons/m-p/68185#M6797</guid>
      <dc:creator>jen123</dc:creator>
      <dc:date>2011-05-21T23:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Numeric Comparisons</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-Numeric-Comparisons/m-p/68186#M6798</link>
      <description>I don't know why line 9 of the original posting is differnt once posted.  In my code to use the characters to represent "greater than or Equal to" and "less than or equal to" - I don't spell it out in my codes.  I just don't know why this forum deletes them from my codes below.&lt;BR /&gt;
&lt;BR /&gt;
Here is what I would like for SAS EG to return one of the three performance:&lt;BR /&gt;
&lt;BR /&gt;
*if WeightedAvg_NCL Less Than or Equal to Standard_NCL and ApprovalRate Greater Than or Equal to Standard_ApprovalRate then de='effective';&lt;BR /&gt;
&lt;BR /&gt;
*if WeightedAvg_NCL &amp;gt; Standard_NCL and ApprovalRate &amp;lt; Standard_ApprovalRate then de='ineffective';&lt;BR /&gt;
&lt;BR /&gt;
*if WeightedAvg_NCL = Standard_NCL and ApprovalRate = Standard_ApprovalRate then de='meet'&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks again!&lt;BR /&gt;
&lt;BR /&gt;
****************&lt;BR /&gt;
3          PROC SQL NOEXEC;&lt;BR /&gt;
4             SELECT t1.WeightedAvg_NCL,&lt;BR /&gt;
5                    t1.ApprovalRate,&lt;BR /&gt;
6                    t2.Standard_NCL,&lt;BR /&gt;
7                    t2.Standard_ApprovalRate,&lt;BR /&gt;
8                    /* Decision Effectivness */&lt;BR /&gt;
9                      (if WeightedAvg_NCL &amp;lt;= Standard_NCL and ApprovalRate &amp;gt;= Standard_ApprovalRate then de='effective';&lt;BR /&gt;
                           _______________&lt;BR /&gt;
                           22&lt;BR /&gt;
                           76&lt;BR /&gt;
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, (, *, **, +, -, '.', /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, AND, EQ, EQT, &lt;BR /&gt;
              GE, GET, GT, GTT, LE, LET, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.  &lt;BR /&gt;
&lt;BR /&gt;
ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;
&lt;BR /&gt;
9                                                                                                                         if&lt;BR /&gt;
                                                                                                                          __&lt;BR /&gt;
                                                                                                                          180&lt;BR /&gt;
ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;
&lt;BR /&gt;
10                      WeightedAvg_NCL &amp;gt; Standard_NCL and ApprovalRate &amp;lt; Standard_ApprovalRate then de='ineffective';&lt;BR /&gt;
10       !                                                                                                            ) AS&lt;BR /&gt;
                                                                                                                      _&lt;BR /&gt;
                                                                                                                      180&lt;BR /&gt;
ERROR 180-322: Statement is not valid or it is used out of proper order.</description>
      <pubDate>Sat, 21 May 2011 23:50:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-Numeric-Comparisons/m-p/68186#M6798</guid>
      <dc:creator>jen123</dc:creator>
      <dc:date>2011-05-21T23:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Numeric Comparisons</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-Numeric-Comparisons/m-p/68187#M6799</link>
      <description>There are no if statements in proc sql.  You need to use a case statement.&lt;BR /&gt;
&lt;BR /&gt;
case when a is true then b when c is true then d else e end as VarName&lt;BR /&gt;
&lt;BR /&gt;
alternatively you can check multiple values of one variable as in&lt;BR /&gt;
&lt;BR /&gt;
case a when b then c when d then e else f end as varname&lt;BR /&gt;
&lt;BR /&gt;
means if a=b then varname=c elseif a=d then varname=e else f</description>
      <pubDate>Sun, 22 May 2011 02:15:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-Numeric-Comparisons/m-p/68187#M6799</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2011-05-22T02:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Numeric Comparisons</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-Numeric-Comparisons/m-p/68188#M6800</link>
      <description>You'll have another problem. JOINs in SQL perform quite differently from SETs in DATA steps. If you don't provide join specifications, SQL will combine every record in dataset one with every record in dataset two, so you'll get a combinatorial explosion.&lt;BR /&gt;
&lt;BR /&gt;
Tom</description>
      <pubDate>Mon, 23 May 2011 15:25:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-Numeric-Comparisons/m-p/68188#M6800</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2011-05-23T15:25:13Z</dc:date>
    </item>
  </channel>
</rss>

