Chapter 17: Bind Programs

This chapter describes the Bind Programs tool which bind or re-binds packages to a selected database.

17.1 Bind Programs Tool

You can use this tool to quickly do mass bind or re-binds of packages to a database by selecting which packages that you want bound and setting the bind options via the Bind Options tab. This allows organizations to quickly share common programs between developers which have there own copy of SQL tables without having each developer re-compile all the common programs.

For this tool to be utilized, you must compile your programs with the DB2 BIND directive set.

The Bind Programs tool (see Figure 17-1) appears when you click HCO > Bind Programs on the Tools menu.



Figure 17-1: Bind Programs Tool Window

The following elements make up the Bind Programs - Select tab window:

17.2 Bind Options Tab

To set drive/directory where bind files are located and options that you want each package bound with, click on the Bind Options tab (see Figure 17-2).



Figure 17-2: Bind Options Tab

The following elements make up the Bind Programs - Options tab:

17.2.1 Setting Bind Options

Before you can bind anything, you need to either enter the directory where bind files are located or click on the Browse push button. This will display a directory list box (see Figure 17-3) where you select the drive/directory where the bind files are located.



Figure 17-3: Select Bind File Directory

One of the "features" of this routine is that you have to select a bind file for the directory to be returned to the tool. Once you have selected a file, click on the Open push button. The Bind File Directory entry field will then be updated.

Set the bind options from the available entry fields or selection boxes. Entries left blank or selection boxes with no selection are ignored. All setting are saved in the registry so the next time you use this tool, the previous setting are automatically displayed.

Please note: You only need to set bind options that are different than the options specified when the program was compiled as those bind options are stored with the bind file.

You can now click on the Select tab and the list box of available files that can be bound will be updated with the number of bind files found (see Figure 17-1).

17.3 Setting Log File Directory

As each file is bound, a log file is written that contains any messages that pertain to the bind. Normally, the Bind Programs tools uses the first directory in the Listing output path. The directory that messages are written to must have write permissions or the bind will fail. You can set this directory to something else by selecting the Workgroup tab, and selecting the Add Output Folder menu selection off of the Listing output tree selection under Output Libraries (see Figure 17-4).



Figure 17-4: Add Folder

Select the location that you want the log files to be written to and then click on the OK push button. The folder is then added to the Listing output tree at the end. You now must select it and drag the folder until it is the first one listed (see Figure 17-5).



Figure 17-5: Re-order Output listing directories

17.4 Run Bind Programs tool

To bind packages to a database you must do the following;

  1. Set bind option via the Bind Options tab
  2. Select database from the Available Database selection box
  3. Select each bind file to be bound or click on the Bind All check box if you want to select all bind files
  4. Click on the Bind push button

As each program is processed, the file is de-selected from the list box and a message about the results is written to the HCO Log tab. When all files have been processed, a message box is displayed indicating processing has completed. If a bind fails, the log contains the full drive/directory of the file and you can double click on the file name and the file is then displayed in the IDE (see Figure 17-6).



Figure 17-6: Displaying Bind Failures

If your drive/directory contains spacey file names, you can not double click on the log file and have it automatically opened by the IDE. Rather you have to open the file using the File menu.

A log file is created for each file bound with the file name bing the format: HCOBIND-<bind file name>.TXT


Copyright © 2001 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.