Created On:  14 February 2012

Problem:

A COBOL program which interoperates with a .Net Assembly returns this error at compile time:

prog.cbl, line nn: Verb expected, '(' found

Resolution:

The error is returned because ACUCOBOL-GT compiler found a MODIFY statement in the source code before of the related CREATE.

The reason is that until the CREATE statement is compiled, the compiler doesn't know what type of control the handle refers to and so it can't check the method it's attempting to call.

One solution may be to change the source code, moving the CREATE statement block before the MODIFY's.

A finest solution is to declare what the handle type is in the working storage section.

I.e.: a generic handle definition like this:
77  MYASSEMBLY-HANDLE USAGE IS EXTERNAL HANDLE.

may be improved this way:
77  MYASSEMBLY-HANDLE USAGE IS EXTERNAL HANDLE OF "@assembly[[.namespace].class]".
Incident #2555824