Highlighted
Absent Member.
Absent Member.
1787 views

Visual COBOL R4 - DB2 and MQ project set up

Jump to solution

[Migrated content. Thread originally posted on 03 January 2012]

In my company we have been using Mainframe Express for several years to develop and test our COBOL mainframe portfolio on windows. We have also done some small scale testing using netExpress and Enterprise Server with positive result but have no customers in production yet on this platform.

To be even more platform independent, I have started to investigate Visual COBOL R4. I want to focus on program with plain COBOL + SQL and MQ.
I was successfully making a COBOL project that connects to our DB2 server. But I did not find any documentation about MQ API. I got Run-time error:
“ 173 Called program file not found in drive/directory: MQCONN”
I have tried to link mqiccbb.Lib and/or mqiccb32.Lib but with same result.
Is anybody aware of any examples how to set up a COBOL project with MQ API?

I also got problem when trying making a COBOL JVM project that connects to our DB2 server. I got the following build error:
[cobol] Execution error : file 'ilgen'
[cobol] error code: 114, pc=0, call=1, seg=0
[cobol] 114 Attempt to access item beyond bounds of memory (Signal 11)

I tried to include db2jcc.jar and db2jcc_license_cu.jar in Java Build path but with same result
Is anybody aware of any examples how to set up a COBOL JVM project with DB2 access (and preferably MQ API)?
0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Visual COBOL R4 - DB2 and MQ project set up

Jump to solution
The Visual COBOL JVM support for OpenESQL using JDBC is not currently available on Unix systems. This support will be available in the next release of Visual COBOL JVM.

If you are using Visual COBOL JVM on Windows then the support is available in Visual COBOL R4 Update 2 only.
This provides access to DB2 through JDBC support and not directly through the DB2 directive which uses the DB2 ECM instead.

The DB2 ECM is only available for native COBOL programs not JVM.

MQSeries support is available in native code by either using the LITLINK directive at compile time and adding the correct library to the link libraries or by loading the MQSeries .dll using a procedure pointer as shown below:

Use the Procedure-Pointer method, which will permit the same program to be run on a machine running MQSeries Client, or the MQSeries Server. This does not require the addition of MQMCB32.LIB or MQICCB32.LIB when creating EXE or DLL.


       IDENTIFICATION DIVISION.
       PROGRAM-ID. 'MQODBCPUT'
       environment division.
       WORKING-STORAGE SECTION.
       01  WORK-AREAS.
           05  LIBPTR               PROCEDURE-POINTER.
           05  BADPTR               PROCEDURE-POINTER.

       PROCEDURE DIVISION.

          SET LIBPTR TO ENTRY "MQMCB32".
          SET BADPTR TO ENTRY "xyzzy"

          if LIBPTR = BadPtr
             SET LIBPTR TO ENTRY "mqiccb32"
          end-if
         
          CALL    'MQCONN'
             USING ...


View solution in original post

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Visual COBOL R4 - DB2 and MQ project set up

Jump to solution
The Visual COBOL JVM support for OpenESQL using JDBC is not currently available on Unix systems. This support will be available in the next release of Visual COBOL JVM.

If you are using Visual COBOL JVM on Windows then the support is available in Visual COBOL R4 Update 2 only.
This provides access to DB2 through JDBC support and not directly through the DB2 directive which uses the DB2 ECM instead.

The DB2 ECM is only available for native COBOL programs not JVM.

MQSeries support is available in native code by either using the LITLINK directive at compile time and adding the correct library to the link libraries or by loading the MQSeries .dll using a procedure pointer as shown below:

Use the Procedure-Pointer method, which will permit the same program to be run on a machine running MQSeries Client, or the MQSeries Server. This does not require the addition of MQMCB32.LIB or MQICCB32.LIB when creating EXE or DLL.


       IDENTIFICATION DIVISION.
       PROGRAM-ID. 'MQODBCPUT'
       environment division.
       WORKING-STORAGE SECTION.
       01  WORK-AREAS.
           05  LIBPTR               PROCEDURE-POINTER.
           05  BADPTR               PROCEDURE-POINTER.

       PROCEDURE DIVISION.

          SET LIBPTR TO ENTRY "MQMCB32".
          SET BADPTR TO ENTRY "xyzzy"

          if LIBPTR = BadPtr
             SET LIBPTR TO ENTRY "mqiccb32"
          end-if
         
          CALL    'MQCONN'
             USING ...


View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Visual COBOL R4 - DB2 and MQ project set up

Jump to solution
To clarify one of Chris's points, to connect to DB2 from a JVM application, you would need to use OpenESQL, specifically, compiling with the SQL(DBMAN=JDBC) directive.

For further information on using this feature, see the JDBC help topic within the Visual COBOL for Eclipse documentation.

SimonT.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.