Created On:  23 March 2011

Problem:

We encountered the following problem when we compiled a program that uses NEXT VALUE expression for a SEQUENCE running HCO in Microfocus Mainframe Express, version 3.1 WrapPack 08.

COBDB0100S SQL0104N  An unexpected token ":WSN-NUM-PRG      = (NEXT VALUE FOR IPSEQBNF)" was found following "SET ".  Expected tokens may include:  "".  SQLSTATE=42601   : "C:\\mfuser31\\Incidents\\Problema su SEQUENCE\\TESTSQL\\Source\\Testsql2.CBL"(41,19)

Compilation complete with 1 errors, 0 warnings, 0 notices and an exit code of 12

The precompiled  fails to interpret the SET command on a SEQUENCE.

       EXEC SQL

        SET :WSN-NUM-PRG = (NEXT VALUE FOR IPSEQBNF)

      END-EXEC.

We use the following environment:

            DB2 Client 9.5  on the local machine where MFE is installed. 

            DB2 Server 8.2  on another server which is accessed via DB2 Client.

Resolution:

DB2 UDB V8.2 is no longer supported by IBM or Micro Focus since we can only support versions that IBM supports.  The statement in question probably is not supported by that version of DB2 UDB.  You could determine that by looking at the SQL Reference provided with that version. The statement is supported by the current version of DB2 LUW versions  9.5 and V9.7.  In order to use this statement you can upgrade to DB2 LUW versions supporting the statement in question.
Incident #2503086