Created On:  02 February 2011


Micro Focus COBOL programs can include SQL statements,  but does not enforce the use of either an explicit  COPY SQLCA or EXEC SQL INCLUDE SQLCA END-EXEC statement.  This can be included by a pre-processor or precompiler at build/compile time.

If this source is verified in Modernization Workbench using the default settings, the verification will fail as any reference to fileds such as SQLCODE  are undefined. How can this code be successfully verified?


To overcome this problem, simply add the following statement to a "workspace"  LEGACY.XML file in the Micro Focus COBOL parser section.

<Copybook type="auto;working;readonly">SQLCA.cpyCopybook>

To do this we create a file called LEGACY.XML and place it in the workspace directory.
Attached is a zip file containing an example of the LEGACY.XML file to solve this issue.

This file will be used in conjunction with the "installed" LEGACY.XML file during verification.

This change to the LEGACY.XML file, actually forces the inclusion of the SQLCA.CPY file.

Note: If any Micro Focus Cobol source already contains a COPY SQLCA or EXEC SQL INCLUDE SQLCA END-EXEC, then this will cause a warning message to be issued saying ‘Warning 8089 - COPY statement has been ignored’.
Incident #2499472