Information Catalog Manager Programming Guide and Reference

An overview of writing a C language program

This section outlines the steps for writing and running a C language program that uses the Information Catalog Manager API calls. Most of this information is standard for any C language program you write.

Creating C language source code

To build an Information Catalog Manager application using C language:

  1. Create the source code.
  2. Compile the source code using a C compiler.
  3. Link the object files with the Information Catalog Manager and C language libraries to produce an executable program.

    The Information Catalog Manager library is DGWAPI.LIB.

  4. Execute the application.

Setting up your environment

Use the following steps to set up your environment to compile and run the Information Catalog Manager programs written in the C language:

  1. Install the compilers.
  2. Verify the LIBPATH.

    The LIBPATH= environment variable must include the x:\SQLLIB directory, where x is the drive where you installed DB2 UDB.

  3. Set environment variables. You set environment variables either in your AUTOEXEC.BAT or from the Microsoft Visual C++ Compiler menu bar (include file path and library file path).

    The SET INCLUDE= statement must include the x:\SQLLIB\LIB directory. The directory containing the WINDOWS.H should also be specified on SET INCLUDE=.

    SET LIB= must include the x:\SQLLIB\LIB directory.

Compiling and linking your application

To compile your application using Microsoft Visual C++ Compiler you need to issue a command such as:
cl /c filename.c

You might need or want to add other options, depending on the compiler you use and the way you write your program.

To link your program, issue a command such as:
link /dll dgwapi.lib filename.obj


[ Top of Page | Previous Page | Next Page ]