Problem:
Release 4.0:
Migrating from IBM's DB2 and compiling a source including Oracle's SUM and CASE function respectively:
SELECT ...
SUM(CASE TRIGGERTABLE
WHEN 'RS032' THEN 1 ELSE 0
END)
...
and getting back compiler error:
COBCH0149S No SQL directives have been set :
N:\\mf_ora\\Source\\cobol\\RS032.cbl(143,15)
COBPR0000S 000400:Encountered the symbol "TRIGGERTABLE" when expecting one of the fol : N:\\mf_ora\\Source\\cobol\\RS032.cbl(147,44)
COBPR0000S 000400:Encountered the symbol ")" when expecting one of the following: : N:\\mf_ora\\Source\\cobol\\RS032.cbl(149,31)
...
What should we do to prevent this error?
Resolution:
First, you should put the source into Oracle's Pro*COBOL precompiler environment directly to check whether you will get the same error or not, i.e:
>procob iname=RS032.cbl oname=myapp.cbl comp5=yes varchar=yes picx=varchar2 END_OF_FETCH=100
If Oracle's Pro*COBOL precompiler encounters the same source line and gets back an error message as above:
PCB-S-00400 Encountered the symbol "TRIGGERTABLE" when expecting one of the following ...
this is a known Oracle issue in version 9.2.0.1 and upgrading Oracle's environment to version 9.2.0.7 resolved this problem. Refer to Oracle bug # 2822740 for further details.
