<?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: Syntax error in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Syntax-error/m-p/888956#M43448</link>
    <description>&lt;P&gt;Please post the log of the whole statement, from the previous semicolon which ends the preceding statement up to the semicolon which ends this statement.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Aug 2023 15:16:44 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2023-08-11T15:16:44Z</dc:date>
    <item>
      <title>Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Syntax-error/m-p/888950#M43445</link>
      <description>&lt;P&gt;Dear community,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have been trying to apply the next formula in SAS:&lt;/P&gt;
&lt;P&gt;b = (0.11852-0.05478*log(pd))^2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, the log is giving me the following, not sure how to deal with it:&lt;/P&gt;
&lt;PRE&gt;                                                                       b = (0.11852-0.05478*log(pd))^2
                                                                                     _
                                                                                     22
                                                                                     76
ERROR 22-322: Syntax error, expecting one of the following: ;, !, !!, &amp;amp;, *, **, +, -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;&amp;lt;, &amp;gt;=, AND, EQ, GE, GT, 
              IN, LE, LT, NE, NOTIN, OR, ^&amp;lt;, ^=, ^&amp;gt;, |, ||, ~&amp;lt;, ~=, ~&amp;gt;.  
ERROR 76-322: Syntax error, statement will be ignored.&lt;/PRE&gt;
&lt;P&gt;Could you please suggest?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stefan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 15:03:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Syntax-error/m-p/888950#M43445</guid>
      <dc:creator>Stepik</dc:creator>
      <dc:date>2023-08-11T15:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Syntax-error/m-p/888954#M43446</link>
      <description>&lt;P&gt;Your log message looks misaligned.&amp;nbsp; Did you accidentally insert literal TAB characters into your source code?&lt;/P&gt;
&lt;PRE&gt;379  data test;
380    pd=10;
381    b = (0.11852-0.05478*log(pd))^2. ;
                                     --
                                     22
                                     76
ERROR 22-322: Syntax error, expecting one of the following: &amp;lt;, &amp;lt;=, =, &amp;gt;, &amp;gt;=, EQ, GE, GT, LE, LT, NE, NG, NL, ^=, ~=.

ERROR 76-322: Syntax error, statement will be ignored.

382    put pd= b=;
383  run;
&lt;/PRE&gt;
&lt;P&gt;What did you think the ^ character would mean in that location?&lt;/P&gt;
&lt;P&gt;The NOT operator is unary operator and not a binary operator.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you want to raise the value to the power of 2?&amp;nbsp; If so use the ** operator.&lt;/P&gt;
&lt;PRE&gt;384  data test;
385    pd=10;
386    b = (0.11852-0.05478*log(pd))**2. ;
387    put pd= b=;
388  run;

pd=10 b=0.0000579975
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 15:11:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Syntax-error/m-p/888954#M43446</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-08-11T15:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Syntax-error/m-p/888955#M43447</link>
      <description>&lt;P&gt;Show the entire Procedure or data step code, not just the line with the error.&lt;/P&gt;
&lt;P&gt;Quite often some errors are caused by issues related to other lines above the reported problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The text of that message is sort of implying that an OPERATION is expected some where.&lt;/P&gt;
&lt;P&gt;If I use a shorter line of code than you used I get this error:&lt;/P&gt;
&lt;PRE&gt;12   data junk;
13    b = (0.11852-0.05478*log(pd))^2;
                                    -
                                    22
                                    76
ERROR 22-322: Syntax error, expecting one of the following: &amp;lt;, &amp;lt;=, =, &amp;gt;,
              &amp;gt;=, EQ, GE, GT, LE, LT, NE, NG, NL, ^=, ~=.

ERROR 76-322: Syntax error, statement will be ignored.

14   run;

&lt;/PRE&gt;
&lt;P&gt;Which indicates the problem is where the 2 appears.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may need to use ** instead of ^ for exponentiation. ^ is a "not" operator.&lt;/P&gt;
&lt;PRE&gt;15   data junk;
16    b = (0.11852-0.05478*log(pd))** 2;
17   run;

NOTE: Variable pd is uninitialized.
NOTE: Missing values were generated as a result of performing an operation
      on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      1 at 16:22   1 at 16:23
&lt;/PRE&gt;
&lt;P&gt;No error, just note about no value for Pd, which is expected.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 15:13:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Syntax-error/m-p/888955#M43447</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-08-11T15:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Syntax-error/m-p/888956#M43448</link>
      <description>&lt;P&gt;Please post the log of the whole statement, from the previous semicolon which ends the preceding statement up to the semicolon which ends this statement.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 15:16:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Syntax-error/m-p/888956#M43448</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-08-11T15:16:44Z</dc:date>
    </item>
  </channel>
</rss>

