Chapter 2: Getting Started

This chapter points you in the right direction for installing and setting up the Database Connectors™ interface for your particular relational database system (RDBMS). Once Database Connectors is installed and ready, you should return to this chapter to find the information you need for preparing and compiling a COBOL program and running the demo program.

Licensing

Database Connectors is licensed through Sentinel RMS. For information and instructions on licensing Database Connectors, please see Overview of Development Licensing

Database Connectors will always search first for the Sentinal RMS license. If, for some reason, the search for a Sentinal RMS license fails, Connectors checks for an alternate license. In this case, the information you need to install such an alternate is included here.

Installing an Alternate License

You may request a license file for one or more users. The number of users (user limit) is set in your license agreement with Micro Focus. When you receive your products, the package includes product codes and keys for Database Connectors.

You must have the product codes and keys to create the license file. When you install or update your license file, place it in the bin directory of Database Connectors; Database Connectors expects the license file to be in the same directory as the executable file and must be able to locate its license file in order to function. If you have multiple users or interfaces, you may copy the license file onto each machine containing Database Connectors or place Database Connectors and your license file on a shared drive.

The Activator Utility

The Activator utility automates the process of creating a license file. When you install Database Connectors, the Activator utility, activator.exe is installed for you in the installation directory by default.

The last screen of the install has a check box for launching Activator.

Launch the Activator to enter a new or updated product code and key. Note that Activator is case-insensitive and displays only uppercase characters. Activator also ignores embedded spaces and separating characters. License codes and keys do not contain the letters “O” or “I”.

When you have entered your product codes and keys, Activator displays a dialog box that confirms whether license file activation was successful.

Note: If license activation was successful, but you get a message during Database Connectors startup indicating that the license file cannot be found, the license file may not be in the proper directory. Activator determines where to place the license file based on entries in the Windows registry. If no registry entry is found, the license file is placed in the same directory as the Activator executable.

Installation

The installation instructions for your particular RDBMS can be found in the appendices of this manual:

Each of the appendices contains an overview of the Connector functions, installation instructions, setup instructions, technical specifications, and a troubleshooting guide.

Note: Before going any further in this manual, go to the appendix listed above that pertains to your RDBMS and begin the Connector installation and setup processes. Once the installation is complete and you are ready to run, return to this chapter and begin the next section, The Demonstration Program.

The Demonstration Program

As soon as your installation and setup are complete, you may run the demonstration program (demo.cbl) included on your distribution medium. This program illustrates many of the Database Connectors product capabilities, including how to

The demo program simulates what might be used in a distributor’s shipping department. You'll be creating the orderfile table, which contains information about the orders placed by the distributor's customers. The orderfile table has the following columns of information (the database data type and COBOL data type are shown for each).

Note: The data type may be slightly different depending on your RDBMS.

Column Name Data Type COBOL PIC
ORDER_NUM CHAR(4) pic x(4)
ORDER_DATE DATEpic 9(6)
CUSTOMER_NUM     CHAR(3) pic x(3)
SHIP_INSTRUCT CHAR(40) pic x(40)
BACKLOG CHAR(1) pic x
PO_NUM CHAR(10) pic x(10)
SHIP_DATE DATE pic 9(6)
SHIP_WEIGHT NUMBER(8,2) pic 9(6)v99
SHIP_CHARGE NUMBER(6,2)     pic 9(4)v99
PAID_DATE DATE pic 9(6)

Here is the COBOL file descriptor (FD) that matches the orderfile table. Note that the FD entries must match the names of the RDBMS fields and must match their data types:

fd  orders.
01  order-record.
    03  order-num              pic x(4).
    03  order-fields.
        05  order-date         pic 9(6).
        05  customer-num       pic x(3).
        05  ship-instruct      pic x(40).
        05  backlog            pic x.
        05  po-num             pic x(10).
        05  ship-date          pic 9(6).
        05  ship-weight        pic 9(6)v99.
        05  ship-charge        pic 9(4)v99.
        05  paid-date          pic 9(6).

First compile the demo program, demo.cbl using compile commands. The demo.cbl program contains compiler directives at the top of the program to generate an eXtended File Descriptors (XFD) file called orderfile.xfd and to specify using the ACUFH file handler. (For information about XFDs, see the chapter XFDs.) You may also specify these directives on your compile command line. The run-time system will use this XFD to map RDBMS data types to COBOL data types.

How to...

As an alternative to using the demo program to create tables, Database Connectors will create new tables in the target database when your COBOL application issues an “OPEN OUTPUT” command. If you turn on file tracing for a COBOL program that performs this operation on a target file, you can see the series of SQL statements generated by the run-time system to create the database table, indexes, and access permissions. This can be useful should you wish to have a set of stand-alone SQL scripts to generate test databases or base set of tables for an end user install for your COBOL files to work with.

Related Topic:

XFDs


Copyright © 2009 Micro Focus (IP) Ltd. All rights reserved.