Application Delivery Management
Application Modernization & Connectivity
CyberRes
IT Operations Management
The background is that a customer is trying build a Pro*COBOL application with the COBSQL preprocessor using ED/VC 6.0 in Visual Studio.
The following problems were reported:
Solution
For 1., customer misunderstood that the values “.cbl,.cob,.cpf,.cpv,.cpy” in “VS->Tools->Options->Text Editor->Micro Focus COBOL->Advanced->Copybook extensions” applies to the COBOL compiler but in fact, that value is only recognized by the Text Editor. In order for the COBOL compiler to recognize .cob extension, the COBOL compiler directive “copyext(cbl,cpy,cob)” must be used. Also, the COBOL copybook Paths must be set correctly in the Project Settings.
For 2., EXEC SQL INCLUDE statements are being processed by the Pro*COBOL/COBSQL preprocessor instead of the COBOL compiler and the copybook not found error was actually returned by Pro*COBOL. Therefore, the Pro*COBOL related options must be set in the Project/Program Settings->SQL->ESQL Preprocessor(COBSQL)->Additional directives. Here is the doc on Pro*COBOL directives. For this particular case, the Pro*COBOL option INCLUDE should be used.
For 3., this one is a well-known problem, basically, this is an Oracle bug. In the Oracle installation bin folder, there are two dlls – Orasql8.dll and Orasqlxx.dll where xx is the version of the Oracle installed (e.g. 11, 12, 18, 19, etc…). The fix is to remove Orasql8.dll (back it up first), copy Orasqlxx.dll and rename the copy to Orasql8.dll. At the end, there should still be Orasql8.dll and Orasqlxx.dll but they are essentially the same file. Oracle support incident about this issue is here.