<?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: Getting syntax error, expecting one of the following: in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Getting-syntax-error-expecting-one-of-the-following/m-p/868404#M343041</link>
    <description>&lt;P&gt;Perhaps in theory SAS supports SUBSTRING() as an alias for SUBSTR(), but in reality it does not.&lt;/P&gt;
&lt;PRE&gt; 68         
 69         %put &amp;amp;=sysvlong;
 SYSVLONG=9.04.01M7P080620
 70         proc sql;
 71         
 72         create table TEST as
 73         select name,substr(name,1,5) as sub
 74         from sashelp.class
 75         ;
 NOTE: Table WORK.TEST created, with 19 rows and 2 columns.
 
 76         create table TEST as
 77         select name,substring(name,1,8) as sub
                                      _     __
                                      79    22
                                            76
 ERROR 79-322: Expecting a (.
 
 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, FROM, GE, GET, GT, GTT, IN, IS, LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ^, ^=, |, ||, ~, 
               ~=.  
 
 ERROR 76-322: Syntax error, statement will be ignored.
 
 78         from sashelp.class
 79         ;
 NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
 80         quit;
 NOTE: The SAS System stopped processing this step because of errors.
 NOTE: PROCEDURE SQL used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds&lt;/PRE&gt;
&lt;P&gt;The syntax of SUBSTRING is some perverse oververbose sql-eze instead of a simple function call.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table TEST1 as
select name
     , substring(name from 1 for 5) as sub1
     , substr(name,1,5) as sub2
from sashelp.class
;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Apr 2023 03:10:54 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-04-06T03:10:54Z</dc:date>
    <item>
      <title>Getting syntax error, expecting one of the following:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-syntax-error-expecting-one-of-the-following/m-p/868315#M343001</link>
      <description>Proc SQL;&lt;BR /&gt;Create table consumer as select * from ( select arng,src, src_sys as app,substring(srcprd,18) as sub,&lt;BR /&gt;Substring(entryprd,10) as keis&lt;BR /&gt;From cc inner join pp on cc.arng =pp.arng);&lt;BR /&gt;Quit;</description>
      <pubDate>Wed, 05 Apr 2023 17:26:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-syntax-error-expecting-one-of-the-following/m-p/868315#M343001</guid>
      <dc:creator>Lakshmisukanya</dc:creator>
      <dc:date>2023-04-05T17:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Getting syntax error, expecting one of the following:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-syntax-error-expecting-one-of-the-following/m-p/868317#M343002</link>
      <description>&lt;P&gt;Show us the ENTIRE log for this PROC SQL (that's every single line in the log for this PROC SQL,&amp;nbsp;that's every single character in the log for this PROC SQL, with nothing removed).&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 17:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-syntax-error-expecting-one-of-the-following/m-p/868317#M343002</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-04-05T17:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Getting syntax error, expecting one of the following:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-syntax-error-expecting-one-of-the-following/m-p/868336#M343015</link>
      <description>&lt;P&gt;What is SUBSTRING()?&lt;/P&gt;
&lt;P&gt;Did you mean SUBSTR()?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 19:35:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-syntax-error-expecting-one-of-the-following/m-p/868336#M343015</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-04-05T19:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Getting syntax error, expecting one of the following:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-syntax-error-expecting-one-of-the-following/m-p/868400#M343039</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;The substr() function is used to extract a specific substring from a string. It takes in three parameters, the string to extract from, the starting position, and the length of the substring.&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;BR /&gt;SELECT SUBSTR('hello world', 2, 4);&lt;BR /&gt;&lt;BR /&gt;Output: "ello"&lt;BR /&gt;&lt;BR /&gt;The substring() function is similar to substr(), but it takes in two parameters, the string to extract from, and the starting position. It extracts all the characters from the starting position until the end of the string.&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;BR /&gt;SELECT SUBSTRING('hello world', 2);&lt;BR /&gt;&lt;BR /&gt;Output: "ello world"</description>
      <pubDate>Thu, 06 Apr 2023 02:40:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-syntax-error-expecting-one-of-the-following/m-p/868400#M343039</guid>
      <dc:creator>Lakshmisukanya</dc:creator>
      <dc:date>2023-04-06T02:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: Getting syntax error, expecting one of the following:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-syntax-error-expecting-one-of-the-following/m-p/868401#M343040</link>
      <description>&lt;P&gt;SUBSTR and SUBSTRING are equivalent:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="xisDoc-noteGenText"&gt;Note:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;The SUBSTRING function is provided for compatibility with the ANSI SQL standard. You can also use the SAS function SUBSTR.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 02:52:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-syntax-error-expecting-one-of-the-following/m-p/868401#M343040</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-04-06T02:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: Getting syntax error, expecting one of the following:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-syntax-error-expecting-one-of-the-following/m-p/868404#M343041</link>
      <description>&lt;P&gt;Perhaps in theory SAS supports SUBSTRING() as an alias for SUBSTR(), but in reality it does not.&lt;/P&gt;
&lt;PRE&gt; 68         
 69         %put &amp;amp;=sysvlong;
 SYSVLONG=9.04.01M7P080620
 70         proc sql;
 71         
 72         create table TEST as
 73         select name,substr(name,1,5) as sub
 74         from sashelp.class
 75         ;
 NOTE: Table WORK.TEST created, with 19 rows and 2 columns.
 
 76         create table TEST as
 77         select name,substring(name,1,8) as sub
                                      _     __
                                      79    22
                                            76
 ERROR 79-322: Expecting a (.
 
 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, FROM, GE, GET, GT, GTT, IN, IS, LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ^, ^=, |, ||, ~, 
               ~=.  
 
 ERROR 76-322: Syntax error, statement will be ignored.
 
 78         from sashelp.class
 79         ;
 NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
 80         quit;
 NOTE: The SAS System stopped processing this step because of errors.
 NOTE: PROCEDURE SQL used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds&lt;/PRE&gt;
&lt;P&gt;The syntax of SUBSTRING is some perverse oververbose sql-eze instead of a simple function call.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table TEST1 as
select name
     , substring(name from 1 for 5) as sub1
     , substr(name,1,5) as sub2
from sashelp.class
;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 03:10:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-syntax-error-expecting-one-of-the-following/m-p/868404#M343041</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-04-06T03:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Getting syntax error, expecting one of the following:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-syntax-error-expecting-one-of-the-following/m-p/868410#M343044</link>
      <description>&lt;P&gt;Reads like COBOL &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 04:50:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-syntax-error-expecting-one-of-the-following/m-p/868410#M343044</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-06T04:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Getting syntax error, expecting one of the following:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-syntax-error-expecting-one-of-the-following/m-p/868420#M343050</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/441550"&gt;@Lakshmisukanya&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The substr() function is used to extract a specific substring from a string. It takes in three parameters, the string to extract from, the starting position, and the length of the substring.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;SHOW US THE LOG&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 09:43:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-syntax-error-expecting-one-of-the-following/m-p/868420#M343050</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-04-06T09:43:29Z</dc:date>
    </item>
  </channel>
</rss>

