SSQL238: LEXICAL Analysis has detected an invalid TOKEN. Expecting a WITH token or

Document ID : KB000118768
Last Modified Date : 07/11/2018
Show Technical Document Details
Issue:
During the explain of a complex SQL statement the CA Explain Analyzer produces an error for complex SQLs. In this case it produces:
‘SQL238: LEXICAL Analysis has detected an invalid TOKEN. Expecting a WITH token or .’ 
Resolution:

This problem is related to nested table expressions no longer being required to include a correlation clause.  As a workaround,  a correlation id needs to be added after the last paren in order to explain the statement without getting a parser error.   Here is the syntax to add: CORR-ID FOR READ ONLY WITH UR Clause.