<?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: Operators in Expressions in SAS and CASL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894909#M353506</link>
    <description>&lt;P&gt;Yes but it doesn't work for me in CASL either, despite the documentation saying that. I am wondering if there are any differences between the operators in SAS and CASL.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Sep 2023 12:46:45 GMT</pubDate>
    <dc:creator>Gary_Z</dc:creator>
    <dc:date>2023-09-19T12:46:45Z</dc:date>
    <item>
      <title>Operators in Expressions in SAS and CASL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894780#M353459</link>
      <description>&lt;P&gt;Are the behaviors of the operators in expressions the same for SAS and CASL?&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS&lt;/P&gt;&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/lrcon/9.4/p00iah2thp63bmn1lt20esag14lh.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/lrcon/9.4/p00iah2thp63bmn1lt20esag14lh.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CASL&lt;/P&gt;&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_042/caslpg/n1nlmx3yjfv9vrn1xykzhdfu7jgj.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/v_042/caslpg/n1nlmx3yjfv9vrn1xykzhdfu7jgj.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do they all work the same way in CASL and SAS consistently and to produce the same results? Can anyone confirm this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The pages show there are some differences. I'm noticing that in CASL, for example the comparison operator Not Equal to is != but it doesn't work in CASL, it only works with mnemonics like NE, or I need to use the same operator as SAS which is ^=. Has anyone been able to get != to run in CASL?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2023 13:35:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894780#M353459</guid>
      <dc:creator>Gary_Z</dc:creator>
      <dc:date>2023-09-18T13:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Operators in Expressions in SAS and CASL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894870#M353486</link>
      <description>&lt;P&gt;Can you post an example CASL log of it "not working"? If it's in the documentation, but doesn't work I would regard that as a bug. What Viya version are you using?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 00:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894870#M353486</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-09-19T00:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Operators in Expressions in SAS and CASL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894879#M353488</link>
      <description>&lt;P&gt;I have never seen using BANG (exclamation point) work as meaning NOT in SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps it works in pure CASL code?&amp;nbsp; But why use it when you can use something that is easier for others to understand.&amp;nbsp; Such as the NE mnenomic or literally spelling out NOT.&lt;/P&gt;
&lt;PRE&gt;1634  data test;
1635    A=1; B=2;
1636  /* Does nor work in SAS
1637    bang = ! (a = b);
1638  */
1639    caret = a ^= b;
1640    tilde = a ~= b;
1641    mnemonic = a ne b ;
1642    not = not (a = b);
1643  run;

NOTE: The data set WORK.TEST has 1 observations and 6 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.00 seconds


1644
1645  proc print;
1646  run;

NOTE: There were 1 observations read from the data set WORK.TEST.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
&lt;/PRE&gt;
&lt;P&gt;Result&lt;/P&gt;
&lt;PRE&gt;Obs    A    B    caret    tilde    mnemonic    not

 1     1    2      1        1          1        1
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 04:07:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894879#M353488</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-09-19T04:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Operators in Expressions in SAS and CASL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894883#M353490</link>
      <description>&lt;P&gt;The SAS language "not equal" operators are listed as these:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASKiwi_0-1695100624369.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/88136i1CF2F656B9CE733D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASKiwi_0-1695100624369.png" alt="SASKiwi_0-1695100624369.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The exclamation mark isn't included.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 05:18:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894883#M353490</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-09-19T05:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: Operators in Expressions in SAS and CASL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894909#M353506</link>
      <description>&lt;P&gt;Yes but it doesn't work for me in CASL either, despite the documentation saying that. I am wondering if there are any differences between the operators in SAS and CASL.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 12:46:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894909#M353506</guid>
      <dc:creator>Gary_Z</dc:creator>
      <dc:date>2023-09-19T12:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Operators in Expressions in SAS and CASL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894910#M353507</link>
      <description>&lt;P&gt;I am using Viya 4.0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This doesn't work:&lt;/P&gt;&lt;PRE&gt;data casuser.cars;&lt;BR /&gt;   set sashelp.cars;&lt;BR /&gt;   keep Make Model Origin MSRP Type;&lt;BR /&gt;run;&lt;BR /&gt;proc cas;&lt;BR /&gt;    table.fetch / &lt;BR /&gt;       table = {name="cars", &lt;BR /&gt;                caslib="casuser",&lt;BR /&gt;                where = "Type != 'SUV' &amp;amp; MSRP&amp;gt;=75000"};&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ERROR: The WHERE clause 'Type != 'SUV' &amp;amp; MSRP&amp;gt;=75000' could not be parsed as written.&lt;BR /&gt;ERROR: Syntax error detected on line 2 at column 7.  Found =, expecting a name, a quoted string, a numeric constant, a datetime &lt;BR /&gt;       constant, a missing value, INPUT, PUT.  &lt;BR /&gt;ERROR: Failure opening table 'cars'&lt;BR /&gt;ERROR: The action stopped due to errors.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;It only works with ^= or NE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 13:02:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894910#M353507</guid>
      <dc:creator>Gary_Z</dc:creator>
      <dc:date>2023-09-19T13:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Operators in Expressions in SAS and CASL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894913#M353509</link>
      <description>&lt;P&gt;Sounds like the documentation page is wrong.&amp;nbsp; != is not a valid way to specify the not equal operator.&amp;nbsp; So don't use it in your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a FEEDBACK link on every documentation page.&amp;nbsp; Click on that link and give SAS your feedback that the documentation page is wrong about how to code a not equal operator.&amp;nbsp; They will get back to you very quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 13:11:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894913#M353509</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-09-19T13:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Operators in Expressions in SAS and CASL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894917#M353511</link>
      <description>&lt;P&gt;I thought so since I had never been able to get != to work, but do you know if there are any other operator differences between SAS and CASL, where the operator works in one but not the other, or should they both be able to use the same operators and produce consistent results?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 13:24:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894917#M353511</guid>
      <dc:creator>Gary_Z</dc:creator>
      <dc:date>2023-09-19T13:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Operators in Expressions in SAS and CASL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894972#M353537</link>
      <description>&lt;P&gt;If the SAS operators work in CASL (have you tried them?) as listed in my previous message then this is a documentation error. != definitely doesn't work in SAS 9.4.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 19:58:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894972#M353537</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-09-19T19:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Operators in Expressions in SAS and CASL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894976#M353538</link>
      <description>&lt;P&gt;The CASL operators documentation page shows != is a valid operator for CASL, but it doesn't show it in SAS 9.4.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 20:23:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894976#M353538</guid>
      <dc:creator>Gary_Z</dc:creator>
      <dc:date>2023-09-19T20:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Operators in Expressions in SAS and CASL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894977#M353539</link>
      <description>&lt;P&gt;I know that but have you tried the SAS not equal operators in CASL? I don't have Viya available to try.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 20:27:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894977#M353539</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-09-19T20:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Operators in Expressions in SAS and CASL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894980#M353541</link>
      <description>Yes I had already tried NE, ~= and ^= which worked.</description>
      <pubDate>Tue, 19 Sep 2023 20:53:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894980#M353541</guid>
      <dc:creator>Gary_Z</dc:creator>
      <dc:date>2023-09-19T20:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Operators in Expressions in SAS and CASL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894984#M353542</link>
      <description>&lt;P&gt;In that case the CASL operators doc is in error and should show the same operators as the SAS doc.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 21:11:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Operators-in-Expressions-in-SAS-and-CASL/m-p/894984#M353542</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-09-19T21:11:41Z</dc:date>
    </item>
  </channel>
</rss>

