Creating File Descriptors and SELECT Statements

acu4glfd is a Windows-based utility that can help you analyze tables and create File Descriptors and SELECT statements. This utility uses ODBC technology to retrieve table information to list the fields in the table. When possible, the utility also determines a unique index and uses that index as the primary key.

Upon request, acu4glfd generates two kinds of output:

  1. a file descriptor (FD), listing the names of the columns in a table and their associated data types
  2. a SELECT statement for the file

You can COPY the FD and SELECT statement into your COBOL program, although you may need to make some changes, as indicated in this topic.

The acu4glfd utility is intended to help you jump start preparing your table for use with a COBOL program. The program determines the names of the columns, attempts to determine the appropriate ACUCOBOL-GTĀ® data type for the column, and attempts to determine the primary key. acu4glfd does not attempt to identify alternate keys.

Remember, though, that database data is flat, and COBOL data can contain group items and depth. Because table data does not contain information about GROUP structure the way a COBOL program does, it may be necessary for you to tweak the code produced by acu4glfd and specify a picture before the program compiles properly. Any errors produced in this early compilation will assist in fine-tuning the FD for your COBOL program. This saves the time and effort of completely analyzing the table and coding the FD and SELECT statements yourself.

The acu4glfd utility operates only on data types that are understood by ODBC. Database drivers can define their own data types as well; these driver-defined data types are not recognized by acu4glfd. Therefore, the utility may not be able to identify all data types represented in the table. Refer to your database, driver, and ODBC documentation for additional information. Before starting the acu4glfd utility, you must define your table/data as an ODBC data source. See your ODBC documentation for information about drivers and data sources.

Note that the examples are based on the following table in Microsoft Access.


BKGLGLCOBL01-low.gif

Note that the phone number (PHONE field) is the table's key.


BKGLGLCOBL02-low.gif