Errors reported when compiling/running Pro*COBOL/COBSQL programs within Visual Studio IDE

0 Likes
7 months ago

Symptoms

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:

  1. Copybooks with .cob extension via COPY statement were not recognized by the compiler.
    e.g. COPY FRED.

  2. Copybooks with .cob extension via EXEC SQL INCLUDE were not recognized by the COBSQL preprocessor
    e.g. EXEC SQL INCLUDE FRED END-EXEC.

  3. When running Pro*COBOL applications, RTS 173 error occurred: SQLADR not found


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.

 

Labels:

Oracle
Visual Studio
Pro*COBOL
PROCOB
COBSQL
Comment List
Anonymous
Related Discussions
Recommended