<?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 Syntax error in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Syntax-error/m-p/673471#M79278</link>
    <description>&lt;P&gt;hi there&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i get the below error when trying to run my code&lt;/P&gt;&lt;PRE&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, BETWEEN, CONTAINS, EQ, EQT, GE, GET, GT, GTT, IN, IS, LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, THEN, ^, ^=, |&lt;BR /&gt;Syntax error, statement will be ignored&lt;/PRE&gt;&lt;P&gt;code:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select reference,&lt;/P&gt;&lt;P&gt;case when age &amp;gt;= 0 and age&amp;lt;= 10 then '0-10'&lt;/P&gt;&lt;P&gt;when age&amp;gt;=11 and age&amp;lt;=20 then '11-20'&lt;/P&gt;&lt;P&gt;end as AgeBucket&lt;/P&gt;&lt;P&gt;;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jul 2020 15:39:43 GMT</pubDate>
    <dc:creator>Citrine10</dc:creator>
    <dc:date>2020-07-30T15:39:43Z</dc:date>
    <item>
      <title>Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Syntax-error/m-p/673471#M79278</link>
      <description>&lt;P&gt;hi there&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i get the below error when trying to run my code&lt;/P&gt;&lt;PRE&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, BETWEEN, CONTAINS, EQ, EQT, GE, GET, GT, GTT, IN, IS, LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, THEN, ^, ^=, |&lt;BR /&gt;Syntax error, statement will be ignored&lt;/PRE&gt;&lt;P&gt;code:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select reference,&lt;/P&gt;&lt;P&gt;case when age &amp;gt;= 0 and age&amp;lt;= 10 then '0-10'&lt;/P&gt;&lt;P&gt;when age&amp;gt;=11 and age&amp;lt;=20 then '11-20'&lt;/P&gt;&lt;P&gt;end as AgeBucket&lt;/P&gt;&lt;P&gt;;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jul 2020 15:39:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Syntax-error/m-p/673471#M79278</guid>
      <dc:creator>Citrine10</dc:creator>
      <dc:date>2020-07-30T15:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Syntax-error/m-p/673474#M79279</link>
      <description>You have no FROM statement so that isn't a valid SAS query. Did you forget to specify your input data set?</description>
      <pubDate>Thu, 30 Jul 2020 15:41:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Syntax-error/m-p/673474#M79279</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-07-30T15:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Syntax-error/m-p/673475#M79280</link>
      <description>Sorry Reeza i do have a from i just forgot to add it while typing this out as i couldnt copy, paste across different VM's</description>
      <pubDate>Thu, 30 Jul 2020 15:43:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Syntax-error/m-p/673475#M79280</guid>
      <dc:creator>Citrine10</dc:creator>
      <dc:date>2020-07-30T15:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Syntax-error/m-p/673479#M79281</link>
      <description>Well, we need your full query and log to be able to tell you what could be wrong.&lt;BR /&gt;SAS usually underlines the issue or specifies the location (Line/Column number) that make it fairly easily to find the issue if you're familiar with reading the error messages. This means your syntax isn't correct somewhere in your code.</description>
      <pubDate>Thu, 30 Jul 2020 15:48:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Syntax-error/m-p/673479#M79281</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-07-30T15:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Syntax-error/m-p/673481#M79282</link>
      <description>it seems to be giving an error when doing multiple 'when's' in the case statement eg running&lt;BR /&gt;code:&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;select reference,&lt;BR /&gt;case when age &amp;gt;= 0 and age&amp;lt;= 10 then '0-10'&lt;BR /&gt;when age&amp;gt;=11 and age&amp;lt;=20 then '11-20'&lt;BR /&gt;end as AgeBucket&lt;BR /&gt;from table1&lt;BR /&gt;;quit;&lt;BR /&gt;&lt;BR /&gt;but works when running:&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;select reference,&lt;BR /&gt;case when age &amp;gt;= 0 and age&amp;lt;= 10 then '0-10'&lt;BR /&gt;else ''&lt;BR /&gt;end as AgeBucket&lt;BR /&gt;from table1&lt;BR /&gt;;quit;</description>
      <pubDate>Thu, 30 Jul 2020 15:49:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Syntax-error/m-p/673481#M79282</guid>
      <dc:creator>Citrine10</dc:creator>
      <dc:date>2020-07-30T15:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Syntax-error/m-p/673484#M79283</link>
      <description>&lt;P&gt;Both queries look fine. Make sure you don't have spurious characters, like an extra comma or semi-colon.&amp;nbsp; Missing spaces between the tokens so that your string literals look like other types of literals.&amp;nbsp; 'xxx't is a TIME literal. Or just plain invalid characters, like TAB, CR, LF or non-breaking spaces , that might not show anything on the screen.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your second one is more likely to cause errors because you have two quotes right next to each other.&amp;nbsp; Put a space between them to make sure it looks like a string literal instead of just a doubled up embedded quote in the middle of some longer string literal.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jul 2020 16:01:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Syntax-error/m-p/673484#M79283</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-07-30T16:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Syntax-error/m-p/673492#M79284</link>
      <description>&lt;P&gt;Copy the code and all the notes, messages or warnings along with the error messages. Paste all of that into a code box opened with the &amp;lt;/&amp;gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is amazing how many times "code" shown does not actually turn&amp;nbsp; out to be what was actually submitted. Copying the code with the messages for log confirms exactly what was submitted.&lt;/P&gt;
&lt;P&gt;Typically a 22-322 error includes diagnostic characters indicating exactly where SAS determined the error occurred. So you only copied part of the error message and left out all the bits that were telling you where the actual error or was found.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jul 2020 20:16:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Syntax-error/m-p/673492#M79284</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-30T20:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Syntax-error/m-p/673497#M79285</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Copy/paste (!!)&amp;nbsp;&lt;/STRONG&gt;the &lt;U&gt;&lt;EM&gt;whole&lt;/EM&gt;&lt;/U&gt; log, beginning with the PROC SQL statement and ending with the final NOTE about the SQL runtime into a box opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg"&gt;&lt;img src="https://communities.sas.com/skins/images/2FD96521DCF95C42FE57BF2A7CB72678/responsive_peak/images/image_not_found.png" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do not do &lt;U&gt;&lt;EM&gt;anything else&lt;/EM&gt;&lt;/U&gt; with the log text.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jul 2020 16:49:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Syntax-error/m-p/673497#M79285</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-07-30T16:49:02Z</dc:date>
    </item>
  </channel>
</rss>

