Rational Developer for System z, Version 7.6

Building a local batch COBOL application using a remote DB2 connection

This tutorial explains how to build a local batch COBOL application using a remote DB2® connection.
Before you begin, ensure that the remote database connection is catalogued with the DB2 Manager. The information for setting up this connection can be found here at the following Web address: http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp. In the table of contents, open Configuring -> Database systems -> Database connections -> Adding database connections with the Configuration Assistant.

This scenario assumes you have created a local z/OS® project.

To build a local batch COBOL application using a remote DB2 connection, follow these steps:
  1. Open the Local COBOL Build Options property page.
  2. In the SYSLIB field, type the path to the DB2 sqlca.cbl file followed by any other paths that include copybooks that the program uses, separated by semicolons. The default path is C:\Program Files\IBM\SQLLIB\include\cobol_a. Even if the copybook resides in the same project as the COBOL source, the project path must be included in the SYSLIB. For example, C:\Program Files\IBM\SQLLIB\include\cobol_a;C:\myProject\source.
  3. Click the Source contains embedded SQL check box.
  4. If a database connection is configured for the project, click the Browse button, select the database connection name from the list of Database Connections, and click OK.
  5. If a database connection is not configured for the project, follow these steps:
    1. Click New Connection, select the Create New Connection radio button, and click Next.
    2. On the Connection Parameters page, select the database manager to be used for development from the Select a database manager list. For example, DB2 UDB zSeries® V7.
    3. From the JDBC driver drop-down list, select the JDBC driver to use. For example, the default for DB2 UDB is IBM DB2 Universal.
    4. In the Connection URL details fields, type the location, host, and port number of the remote database.
    5. In the User information fields, type a user ID and password.
    6. Click the Test Connection button to ensure the connection parameters are correct and then click Finish.
  6. On the Local Link Options page set Link Options to /de db2api.lib and then click Finish or OK.
  7. In the z/OS Projects view, select your COBOL program and then select Nominate as entry point from the pop-up menu.
  8. Right-click the project name and select Rebuild. The executable that is generated to the BuildOutput folder can now be executed or debugged as a compiled application.

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)