Connect project cobol for eclipse in database oracle and run for debug project

[Migrated content. Thread originally posted on 05 April 2012]

Hello,
sorry for my bad English.
I installed Micro Focus Cobol visual 2010 trial for eclipse (windows 32 bit), I added an application that I want to debug COBOL. But I EXEC SQL ... END EXEC, eclipse tells me that as an error: "COBCH0149S No sql Have Been Set". I want to link to a database compiled and run Oracle for the application to debug COBOL.

How is your project connected to the database eclipse has oracle ?

Where should retract the user and password for database oracle ?

I saw that in the properties of the project "Micro Focus Cobol / property of language / Cobol / addtionnelles guidelines" that we could write "p(cobsql)" or "SQL(DBMan=ODBC). Eclipse tells me that I have 1 error but when I run the application it tells me: "the COBOL program to run could not be found" and the problem he said "connot open file: meprojet.obj"

Thank you for your help.
  • I just tested this here fine with Visual COBOL for Eclipse R4 update 2.

    First you need to know what preprocessor is supposed to be used to compile the program.

    If you are using Oracle's Pro*COBOL then the appropriate Oracle client software including Pro*COBOL has to installed on your computer and must be accessible within the PATH.

    You must be able to connect to the Oracle database using Oracles SQL Developer, etc.

    If you are using OpenESQL then you must also have the Oracle ODBC driver (or 3rd party Oracle ODBC driver) installed and you must have your DSN setup to connect to your database.

    The following instructions are assuming that you have a program that needs to be compiled with Oracle's Pro*COBOL precompiler.

    That means it uses the COBSQL preprocessor of Visual COBOL.
    If you are not using Pro*COBOL then let me know and I will post the instructions for OpenESQL as well.

    Open up the Visual COBOL Eclipse IDE and select File->New COBOL Project and then give the project a name like "oraconnect".

    Click Finish.

    Right click on the project name in Navigator and select New->COBOL Program

    This should create a new program called Program1.cbl in the editor.

    Copy and paste the following over the source for Program1.cbl in the editor:
    You should replace the values of username and paswd with your own if these are not valid.

    This also assumes that you have the Oracle Sample database installed.


           IDENTIFICATION DIVISION.
           PROGRAM-ID.  ORACONNECT.
           ENVIRONMENT DIVISION.
           DATA DIVISION.
           WORKING-STORAGE SECTION.
               exec sql include sqlca end-exec

               EXEC SQL BEGIN DECLARE SECTION END-EXEC.

           01  USERNAME   PIC X(10).
           01  PASSWD     PIC X(10).
           01  emp-name   pic x(50).
               EXEC SQL END DECLARE SECTION END-EXEC.
           PROCEDURE DIVISION.
           LOGON.

                MOVE "SCOTT" TO USERNAME.
                MOVE "TIGER" TO PASSWD.
                EXEC SQL
                    CONNECT :USERNAME IDENTIFIED BY :PASSWD
                END-EXEC.
                DISPLAY sqlcode
                exec sql select EMP.ENAME INTO :emp-name FROM EMP
                   where EMP.EMPNO = 7369
                end-exec
                display emp-name
                stop run.


    Save this.
    Right click on the project name in Navigator again and select Properties.
    Open Micro Focus COBOL-->Build Configurations-->COBOL

    Target Type should be single executable file.
    Platform should be 32-bit.

    Click on the arrow next to Override COBOL Project settings

    In the Additional Directives box copy and paste the following:

    p(cobsql) CSQLT=ORACLE8 MAKESYN VERBOSE KEEPCBL END-C p(cp) ENDP ENDP litlink
    Click Apply

    Now click on the Link tab which is two below the COBOL tab in the properties list.

    In the box for Additional items to be linked (obj, lib, etc)
    enter in the location and name of the appropriate Oracle library,

    On my system for Oracle 11g client it looks like the following:

    C:\app\crg\product\11.2.0\client_1\precomp\LIB\orasql11.lib

    It may have a different name depending on the version of Oracle you are using.

    Click Apply and then OK to close the properties window.

    If everything is setup correctly then it should compile and link cleanly.
    If you get a compile or link error then check the steps above to ensure that the correct information has been entered.

    If it compiles and links cleanly you should then be able to debug the program in the debug perspective.

    Let me know if you have any problems with this.

    Thanks.
  • Hello,

    I modified the PATH by adding: C:\oracle\10G\precomp\LIB
    goal when I compile I have always a mistake, he said he knows not "procob"

    here is the result of the compilation:
    cfg.New_Configuration:
    [cobol]
    [cobol] Compiling dtmx1000.pco...
    [cobol]
    [cobol] * Cobsql Integrated Preprocessor
    [cobol] * CSQL-I-004: Accepted VERBOSE
    [cobol] * CSQL-I-004: Accepted KEEPCBL
    [cobol] * CSQL-I-008: Invoking cp Preprocessor
    [cobol] * CSQL-I-017: Creating "C:\DOCUMENTS AND SETTINGS\LAMBIN_M\WORKSPACE\DEMTEC\dtm
    [cobol] * CSQL-I-018: Invoking Oracle Precompiler/Translator
    [cobol] 'procob' n'est pas reconnu en tant que commande interne
    [cobol] ou externe, un programme ex‚cutable ou un fichier de commandes.
    [cobol] * CSQL-F-021: Precompiler did not complete -- Terminating
    [cobol] Compilation complete with 0 errors, 0 warnings, 0 notices and an exit code of 16
    [cobollink] Linking demtec.exe...
    [cobollink] Micro Focus COBOL - CBLLINK utility
    [cobollink] Version 1.3.2.10 Copyright (C) Micro Focus IP Development Limited 1984-2011.
    [cobollink]
    [cobollink] ERROR: (1) Cannot open file : dtmx1000.obj
    [cobollink] ERROR: (6) No public symbols found. No object file generated
    [cobollink] Link complete with errors

    I do not understand how "procob"

    Thank you for your help

  • C:\oracle\10G\precomp\LIB is not where procob.exe resides.
    This may be the location for the oracle link libraries but procob itself should be in C:\oracle\10G\client_1\bin or some folder name like that.

    Use Windows Explorer and do a search for procob.exe and then add this location to your PATH.

    Thanks.
  • Hi,

    Pro*COBOL is only installed as part of an Oracle client installation, and then, only when you use the Custom installation option - it will show up under either "Oracle Programmer" or "Precompilers". When installed, procob.exe will be located within the "BIN" directory under your Oracle installation. If you have an Oracle server installation - for example Oracle XE, or the full Oracle Database - then I don't believe that Pro*COBOL will be available.

    Note that Oracle provides both 32-bit and 64-bit client-side software, so you need to ensure that you have the appropriate software installed for the applications you wish to build.

    SimonT.
  • Hi,

    Pro*COBOL is only installed as part of an Oracle client installation, and then, only when you use the Custom installation option - it will show up under either "Oracle Programmer" or "Precompilers". When installed, procob.exe will be located within the "BIN" directory under your Oracle installation. If you have an Oracle server installation - for example Oracle XE, or the full Oracle Database - then I don't believe that Pro*COBOL will be available.

    Note that Oracle provides both 32-bit and 64-bit client-side software, so you need to ensure that you have the appropriate software installed for the applications you wish to build.

    SimonT.
  • Hi,

    Pro*COBOL is only installed as part of an Oracle client installation, and then, only when you use the Custom installation option - it will show up under either "Oracle Programmer" or "Precompilers". When installed, procob.exe will be located within the "BIN" directory under your Oracle installation. If you have an Oracle server installation - for example Oracle XE, or the full Oracle Database - then I don't believe that Pro*COBOL will be available.

    Note that Oracle provides both 32-bit and 64-bit client-side software, so you need to ensure that you have the appropriate software installed for the applications you wish to build.

    SimonT.
  • hello,
    Can not find procob.exe I install the version of Oracle 10g and 11g and no pre-Cobol compiler. Could you help me find "procob.exe" or to add a tutorial on the cobol precompiler oracle. In versions of Oracle I install there the pre-compiler c/c "proc.exe". Thank you in advance for your help, I'll tighten very grateful if you find me a solution.

    Sincerely,
  • Verified Answer

    Hi,

    Firstly, please confirm the exact version of the Oracle client-side software you have installed, by executing

    sqlplus /nolog

    and whether you have a 32-bit or 64-bit Oracle client installed.

    With reference to the Oracle support document 43208.1 - which you can access from the Oracle Support website - it documents the platforms where their language precompilers have been certified. For COBOL on Windows, they state :

    32-bit
    * 10.2.0 Micro Focus NetExpress 4.0
    * & ACUCOBOL-GT 6.2
    * 11.1.0 Micro Focus NetExpress 5.0
    * 11.2.0 Micro Focus NetExpress 5.0

    64-bit
    *Cobol < 10.2.0.4 none
    * 10.2.0.4 Micro Focus NetExpress 5.0
    * 10.2.0.4 Micro Focus NetExpress 5.1 (Windows 2008)
    * 11.1.0 Micro Focus NetExpress 5.0
    * 11.2.0 Micro Focus NetExpress 5.0

    So, depending on the fixpack level you have installed, you may need to upgrade to the latest fixpack for your release.

    In order to install Pro*COBOL, when running the Oracle installer, you need to select a Custom Install, choose your existing Oracle home (for the relevant version), and select "Oracle Programmer". If you expand that - there should be a checkbox at the bottom of the dialog box - you should be able to see "Precompilers". Once that has run to completion, then you may need to upgrade to a later Oracle fixpack, based on the information shown above.

    Note that if looking to install Pro*COBOL on UNIX platforms, you *must* have your COBOL environment configured prior to invoking the installer. Otherwise you will not get an option for installing Pro*COBOL.

    Hope this helps.

    SimonT.
  • Hello,
    Thank you, I finally got through they installed the Oracle client version and I have the file "procob.exe".
    So I modify my PATH "C:\oracle\product\10.2.0\client_1\bin;"
    and the properties of the project: Cobol Micro focus/Configuration de la génération/link and
    Additional items to be linked (obj, lib etc), i add : C:\oracle\product\10.2.0\client_1\precomp\LIB\orasql10.lib
    And properties of the language project/Cobol, i add : p(cobsql) CSQLT=ORACLE8 MAKESYN VERBOSE KEEPCBL END-C p(cp) ENDP ENDP litlink

    i have windows 32 bit, and micro focus visal cobol for eclipse.

    When I compile the project for the launch, the Oracle precompiler walk,
    but when the program starts, SQL queries are not executed,
    as if the program does not take into consideration the requests.
    Or when I run my application, compilation stops at 35% ...

    os.init.unix:

    init:

    cfg.New_Configuration:
    [cobol]
    [cobol] Compiling dtmx1000.pco...
    [cobol]
    [cobol] * Cobsql Integrated Preprocessor
    [cobol] * CSQL-I-004: Accepted VERBOSE
    [cobol] * CSQL-I-004: Accepted KEEPCBL
    [cobol] * CSQL-I-008: Invoking cp Preprocessor



    Where does it say where the eclipse will connect to oracle database ? the host ? login and password ?

    Does Eclipse tries to connected to the database and this is why the compiler does not stop ?

    thank you in advance

  • Hello,
    Thank you, I finally got through they installed the Oracle client version and I have the file "procob.exe".
    So I modify my PATH "C:\oracle\product\10.2.0\client_1\bin;"
    and the properties of the project: Cobol Micro focus/Configuration de la génération/link and
    Additional items to be linked (obj, lib etc), i add : C:\oracle\product\10.2.0\client_1\precomp\LIB\orasql10.lib
    And properties of the language project/Cobol, i add : p(cobsql) CSQLT=ORACLE8 MAKESYN VERBOSE KEEPCBL END-C p(cp) ENDP ENDP litlink

    i have windows 32 bit, and micro focus visal cobol for eclipse.

    When I compile the project for the launch, the Oracle precompiler walk,
    but when the program starts, SQL queries are not executed,
    as if the program does not take into consideration the requests.
    Or when I run my application, compilation stops at 35% ...

    os.init.unix:

    init:

    cfg.New_Configuration:
    [cobol]
    [cobol] Compiling dtmx1000.pco...
    [cobol]
    [cobol] * Cobsql Integrated Preprocessor
    [cobol] * CSQL-I-004: Accepted VERBOSE
    [cobol] * CSQL-I-004: Accepted KEEPCBL
    [cobol] * CSQL-I-008: Invoking cp Preprocessor



    Where does it say where the eclipse will connect to oracle database ? the host ? login and password ?

    Does Eclipse tries to connected to the database and this is why the compiler does not stop ?

    thank you in advance