<?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: ERROR 22-322: Syntax error, expecting one of the following: TABLE, VIEW.  ERROR 76-322: Syntax e in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643902#M192229</link>
    <description>hi i corrected that but still getting this error&lt;BR /&gt;ERROR: Function COASLESCE could not be located.&lt;BR /&gt;ERROR: Character expression requires a character format.&lt;BR /&gt;</description>
    <pubDate>Wed, 29 Apr 2020 12:42:00 GMT</pubDate>
    <dc:creator>shweta_234</dc:creator>
    <dc:date>2020-04-29T12:42:00Z</dc:date>
    <item>
      <title>ERROR 22-322: Syntax error, expecting one of the following: TABLE, VIEW.  ERROR 76-322: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643896#M192224</link>
      <description>&lt;P&gt;my code is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create gvkeys as select distinct gvkey, lpermno as permno, tic, coaslesce(linkenddt,'31dec9999') as linkenddt format date9.,tic,&lt;BR /&gt;linkdt format date9. from Gvkeytable;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting error&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: TABLE, VIEW.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can someone tell me what the error is?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 12:34:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643896#M192224</guid>
      <dc:creator>shweta_234</dc:creator>
      <dc:date>2020-04-29T12:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: TABLE, VIEW.  ERROR 76-322: Syntax e</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643900#M192227</link>
      <description>&lt;P&gt;You miss&amp;nbsp;the word TABLE after the CREATE and&lt;/P&gt;
&lt;P&gt;why is tic selected twice?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table gvkeys as 
  select distinct gvkey, lpermno as permno, 
  tic,
  coaslesce(linkenddt,'31dec9999') as linkenddt format date9., 
  tic,
  linkdt format date9. 
from Gvkeytable;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Apr 2020 12:39:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643900#M192227</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-04-29T12:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: TABLE, VIEW.  ERROR 76-322: Syntax e</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643902#M192229</link>
      <description>hi i corrected that but still getting this error&lt;BR /&gt;ERROR: Function COASLESCE could not be located.&lt;BR /&gt;ERROR: Character expression requires a character format.&lt;BR /&gt;</description>
      <pubDate>Wed, 29 Apr 2020 12:42:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643902#M192229</guid>
      <dc:creator>shweta_234</dc:creator>
      <dc:date>2020-04-29T12:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: TABLE, VIEW.  ERROR 76-322: Syntax e</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643903#M192230</link>
      <description>the variable linkenddt has dates of format 30-Jun-78 and in some observations it is 'E".</description>
      <pubDate>Wed, 29 Apr 2020 12:45:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643903#M192230</guid>
      <dc:creator>shweta_234</dc:creator>
      <dc:date>2020-04-29T12:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: TABLE, VIEW.  ERROR 76-322: Syntax e</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643916#M192236</link>
      <description>&lt;P&gt;the function is COALESCE&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 13:10:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643916#M192236</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-04-29T13:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: TABLE, VIEW.  ERROR 76-322: Syntax e</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643917#M192237</link>
      <description>'31dec9999' is a string.   If you want it to be a date then add a d (for date) after the string, eg. use '31dec9999'd   &lt;BR /&gt;</description>
      <pubDate>Wed, 29 Apr 2020 13:12:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643917#M192237</guid>
      <dc:creator>DavePrinsloo</dc:creator>
      <dc:date>2020-04-29T13:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: TABLE, VIEW.  ERROR 76-322: Syntax e</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643920#M192238</link>
      <description>and you need to spell correctly!  COASLESCE is actually COALESCE.   &lt;BR /&gt;I suggest you check these simple errors before posting!</description>
      <pubDate>Wed, 29 Apr 2020 13:14:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643920#M192238</guid>
      <dc:creator>DavePrinsloo</dc:creator>
      <dc:date>2020-04-29T13:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: TABLE, VIEW.  ERROR 76-322: Syntax e</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643922#M192240</link>
      <description>the variable to which i want to use 31dec9999 has dates in some observations and 'E' in some observations.&lt;BR /&gt;How do i get rid of the E's?</description>
      <pubDate>Wed, 29 Apr 2020 13:16:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643922#M192240</guid>
      <dc:creator>shweta_234</dc:creator>
      <dc:date>2020-04-29T13:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: TABLE, VIEW.  ERROR 76-322: Syntax e</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643924#M192242</link>
      <description>&lt;P&gt;It is not the format that matters but the variable type.&lt;/P&gt;
&lt;P&gt;Is it a sas date, a numeric variable? then the date literal need be fixed:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table gvkeys as 
  select distinct gvkey, lpermno as permno, 
  tic,
  coalesce(linkenddt, '31dec9999'd) as linkenddt format date9., 
  linkdt format date9. 
from Gvkeytable;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Apr 2020 13:19:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643924#M192242</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-04-29T13:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: TABLE, VIEW.  ERROR 76-322: Syntax e</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643925#M192243</link>
      <description>Look up the syntax to use  CASE  in your SQL select &lt;BR /&gt;</description>
      <pubDate>Wed, 29 Apr 2020 13:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643925#M192243</guid>
      <dc:creator>DavePrinsloo</dc:creator>
      <dc:date>2020-04-29T13:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: TABLE, VIEW.  ERROR 76-322: Syntax e</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643952#M192258</link>
      <description>&lt;P&gt;The date variable is either numeric with a firmat, like date9., or a char type.&lt;/P&gt;
&lt;P&gt;A numeric date cannot handle a character 'E'.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please run next code and post the result:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=Gvkeytable; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Apr 2020 14:01:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643952#M192258</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-04-29T14:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: TABLE, VIEW.  ERROR 76-322: Syntax e</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643956#M192264</link>
      <description>Hi i ran the mentioned code and results are&lt;BR /&gt;Alphabetic List of Variables and Attributes&lt;BR /&gt;# Variable Type Len Format Informat&lt;BR /&gt;1 GVKEY Num 8 BEST12. BEST32.&lt;BR /&gt;3 LIID Num 8 BEST12. BEST32.&lt;BR /&gt;6 LINKDT Num 8 DATE9. DATE9.&lt;BR /&gt;7 LINKENDDT Char 9 $9. $9.&lt;BR /&gt;2 LINKPRIM Char 1 $1. $1.&lt;BR /&gt;4 LINKTYPE Char 2 $2. $2.&lt;BR /&gt;5 LPERMNO Num 8 BEST12. BEST32.&lt;BR /&gt;18 ajexq Num 8 BEST12. BEST32.&lt;BR /&gt;23 atq Num 8 BEST12. BEST32.&lt;BR /&gt;45 co_cik Num 8 BEST12. BEST32.&lt;BR /&gt;42 co_conm Char 27 $27. $27.&lt;BR /&gt;44 co_cusip Char 9 $9. $9.&lt;BR /&gt;47 co_naics Num 8 BEST12. BEST32.&lt;BR /&gt;46 co_sic Num 8 BEST12. BEST32.&lt;BR /&gt;43 co_tic Char 3 $3. $3.&lt;BR /&gt;17 conm Char 21 $21. $21.&lt;BR /&gt;33 conml Char 21 $21. $21.&lt;BR /&gt;13 consol Char 1 $1. $1.&lt;BR /&gt;31 costat Char 1 $1. $1.&lt;BR /&gt;24 cshfdq Char 1 $1. $1.&lt;BR /&gt;25 cshoq Num 8 BEST12. BEST32.&lt;BR /&gt;26 cshprq Num 8 BEST12. BEST32.&lt;BR /&gt;19 curcdq Char 3 $3. $3.&lt;BR /&gt;20 datacqtr Num 8 DATETIME. ANYDTDTM40.&lt;BR /&gt;8 datadate Num 8 DATE9. DATE9.&lt;BR /&gt;15 datafmt Char 3 $3. $3.&lt;BR /&gt;21 datafqtr Num 8 DATETIME. ANYDTDTM40.&lt;BR /&gt;27 epsfxq Num 8 BEST12. BEST32.&lt;BR /&gt;28 epspxq Num 8 BEST12. BEST32.&lt;BR /&gt;10 fqtr Num 8 BEST12. BEST32.&lt;BR /&gt;36 from Num 8 DATE9. DATE9.&lt;BR /&gt;9 fyearq Num 8 BEST12. BEST32.&lt;BR /&gt;11 fyr Num 8 BEST12. BEST32.&lt;BR /&gt;35 gvkeyx Num 8 BEST12. BEST32.&lt;BR /&gt;34 iid Num 8 BEST12. BEST32.&lt;BR /&gt;41 indexcat Char 3 $3. $3.&lt;BR /&gt;38 indextype Char 5 $5. $5.&lt;BR /&gt;12 indfmt Char 4 $4. $4.&lt;BR /&gt;14 popsrc Char 1 $1. $1.&lt;BR /&gt;32 prccq Num 8 BEST12. BEST32.&lt;BR /&gt;22 rdq Num 8 DATE9. DATE9.&lt;BR /&gt;29 saleq Num 8 BEST12. BEST32.&lt;BR /&gt;39 spii Char 1 $1. $1.&lt;BR /&gt;30 spiq Num 8 BEST12. BEST32.&lt;BR /&gt;40 spmi Num 8 BEST12. BEST32.&lt;BR /&gt;37 thru Char 1 $1. $1.&lt;BR /&gt;16 tic Char 4 $4. $4.&lt;BR /&gt;</description>
      <pubDate>Wed, 29 Apr 2020 14:11:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643956#M192264</guid>
      <dc:creator>shweta_234</dc:creator>
      <dc:date>2020-04-29T14:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: TABLE, VIEW.  ERROR 76-322: Syntax e</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643962#M192269</link>
      <description>&lt;P&gt;Looks like you have a character variable.&lt;/P&gt;
&lt;PRE&gt;7 LINKENDDT Char 9 $9. $9.&lt;/PRE&gt;
&lt;P&gt;Most likely at some point you used to have a numeric variable that was using the .E special missing to indicate the on-going (no End date).&lt;/P&gt;
&lt;P&gt;Do you want to keep it as a character variable?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;case when (linkenddt in (' ','E','e')) then '31DEC9999' else linkenddt end&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or convert it to an actual date?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;coalesce(input(linkenddt,?date9.),'31DEC9999'd) format=date9.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Apr 2020 14:22:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Syntax-error-expecting-one-of-the-following-TABLE/m-p/643962#M192269</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-04-29T14:22:45Z</dc:date>
    </item>
  </channel>
</rss>

