DB2 Universal Database Version 6.1 SDK for Windows NT, Windows 98, and Windows 95 
README file
================================================================================
Last updated : April, 1999.

The following is a table of sample programs that are included in this release
of IBM DB2 Universal Database.

These programming examples are for the COBOL programming language, using IBM
VisualAge COBOL. This compiler provides a COBOL development environment 
for OS/2, Windows NT, Windows 98, and Windows 95. The files are located in the 
"sqllib\samples\cobol" directory. Copy them to your working directory prior 
to building the sample programs.

WARNING: Some of these samples will change your database manager
         configuration.  Execute the samples in a test instance only.

For more information on programming in COBOL, refer to the:
    -  "Programming in COBOL" section of the Application Development Guide.

For more information on Building COBOL Applications, refer to the:
    - "Building COBOL Applications" section of the Application Building Guide.

For more information on the SQL language, refer to the SQL Reference.

For the latest information on programming, compiling, and running DB2 
applications, refer to the DB2 application development website at 
http://www.software.ibm.com/data/db2/udb/ad

   +--------------------------------------------+
+--+How to build the SAMPLE programs using nmake+-----------------------------+
|  +--------------------------------------------+                             |
|  Note: The supplied makefile runs the IBM VisualAge COBOL compiler.         |
|                                                                             | |                                                                             |
|    Before building the sample programs, you require:                        |
|    - The sample database (created with the db2sampl commmand).              |
|    - The database manager must be started (with the db2start command).      |
|    - Write permission to the the "sqllib\function" directory of             |
|      the database instance prior to building the following programs:        |
|                                                                             |
|         outsrv.sqb                                                          |
|         inpsrv.sqb                                                          |
|                                                                             |
|  Using the makefile in this directory, you can build any of the supplied    |
|  sample programs in one step by entering the following command:             |
|                                                                             |
|     nmake <prog_name>  (eg. nmake updat)                                    |
|                                                                             |
|  You can also use the makefile to build all the supplied sample programs    |
|  in one step by entering the following command:                             |
|                                                                             |
|     nmake all                                                               |
|                                                                             |
|  To remove the intermediate files, enter:                                   |
|                                                                             |
|     nmake clean                                                             |
|                                                                             |
|  To remove all intermediate and the resulting executables, enter:           |
|                                                                             |
|     nmake cleanall                                                          |
|                                                                             |
|  Although the makefile is easier to use, it may be more difficult to        |
|  understand, so script files are also included, as described below.         |
+-----------------------------------------------------------------------------+


   +----------------------------------------------------+
+--+How to build the SAMPLE programs using command files+---------------------+
|  +----------------------------------------------------+                     |
| To compile the following programs, you need to invoke the proper build      |
| commands. The supplied command files are listed near the end of this README |
| file. For detailed information on the content of these build command files  |
| and additional setup information, see the "Application Building Guide".     |
+-----------------------------------------------------------------------------+

Table Legend:
=============
  NOTES:  CLI    A client application, which calls a stored procedure or 
                 declares and calls a user-defined function on the server.
          DDB    Requires a default database designated by environment
                 variable DB2DBDFT.
          IPX    Runs only on a machine using IPX communications protocol.
          MPP    Designed to run specifically in a partitioned database 
                 environment.
          SRV    You must run this sample locally on the server.
          STP    A stored procedure, which must be stored on the server,
                 and must be called by a corresponding client application.
          UDF    A library of user-defined functions. The library must be 
                 stored on the server, and the functions are declared
                 and called by a corresponding client application.

-------------+------+---------------------------------------------------
 SAMPLE      |NOTES | PROGRAM DESCRIPTION
 PROGRAM     |      |
 NAME        |      |
-------------+------+--------------------------------------------------
 advsql.sqb  |      |An example using advanced SQL expressions like
             |      |CASE, CAST, and scalar fullselects.
-------------+------+--------------------------------------------------
 checkerr.cbl|      |Demonstrates the use of the following APIs:
             |      |     GET ERROR MESSAGE
             |      |     INSTALL SIGNAL HANDLER
             |      |     INTERRUPT
             |      |This program also contains code to output
             |      |information from an SQLDA.
-------------+------+--------------------------------------------------
 client.cbl  |      |Demonstrates the use of the following APIs:
             |      |     SET CLIENT
             |      |     QUERY CLIENT
-------------+------+--------------------------------------------------
 cursor.sqb  |      |Demonstrates the use of a "CURSOR" using static
             |      |SQL.
-------------+------+--------------------------------------------------
 d_dbconf.cbl|      |Demonstrates the use of the following API:
             |      |     GET DATABASE CONFIGURATION DEFAULTS
-------------+------+--------------------------------------------------
 d_dbmcon.cbl|      |Demonstrates the use of the following API:
             |      |     GET DATABASE MANAGER CONFIGURATION DEFAULTS
-------------+------+--------------------------------------------------
 db_udcs.cbl |      |Demonstrates the use of the following APIs to
             |      |simulate the collating behavior of a DB2 for
             |      |MVS/ESA CCSID 500 (EBCDIC International)
             |      |collating sequence:
             |      |     CREATE DATABASE
             |      |     DROP DATABASE
-------------+------+--------------------------------------------------
 dbauth.sqb  |      |Demonstrates the use of the following API:
             |      |     GET AUTHORIZATIONS
-------------+------+--------------------------------------------------
 dbcat.cbl   |      |Demonstrates the use of the following APIs:
             |      |     CATALOG DATABASE
             |      |     CLOSE DATABASE DIRECTORY SCAN
             |      |     GET NEXT DATABASE DIRECTORY ENTRY
             |      |     OPEN DATABASE DIRECTORY SCAN
             |      |     UNCATALOG DATABASE
-------------+------+--------------------------------------------------
 dbcmt.cbl   |      |Demonstrates the use of the following API:
             |      |     CHANGE DATABASE COMMENT
-------------+------+--------------------------------------------------
 dbconf.cbl  |      |Demonstrates the use of the following APIs:
             |      |     CREATE DATABASE
             |      |     DROP DATABASE
             |      |     GET DATABASE CONFIGURATION
             |      |     RESET DATABASE CONFIGURATION
             |      |     UPDATE DATABASE CONFIGURATION
-------------+------+--------------------------------------------------
 dbinst.cbl  |      |Demonstrates the use of the following APIs:
             |      |     ATTACH TO INSTANCE
             |      |     DETACH FROM INSTANCE
             |      |     GET INSTANCE
-------------+------+--------------------------------------------------
 dbmconf.cbl |      |Demonstrates the use of the following APIs:
             |      |     GET DATABASE MANAGER CONFIGURATION
             |      |     RESET DATABASE MANAGER CONFIGURATION
             |      |     UPDATE DATABASE MANAGER CONFIGURATION
-------------+------+--------------------------------------------------
 dbsnap.cbl  |      |Demonstrates the use of the following API:
             |      |     DATABASE MONITOR SNAPSHOT
-------------+------+--------------------------------------------------
 dbstart.cbl | SRV  |Demonstrates the use of the following API:
             |      |     START DATABASE MANAGER
-------------+------+--------------------------------------------------
 dbstat.sqb  |      |Demonstrates the use of the following APIs:
             |      |     REORGANIZE TABLE
             |      |     RUN STATISTICS
-------------+------+--------------------------------------------------
 dbstop.cbl  | SRV  |Demonstrates the use of the following APIs:
             |      |     FORCE USERS
             |      |     STOP DATABASE MANAGER
-------------+------+--------------------------------------------------
 dcscat.cbl  |      |Demonstrates the use of the following APIs:
             |      |     ADD DCS DIRECTORY ENTRY
             |      |     CLOSE DCS DIRECTORY SCAN
             |      |     GET DCS DIRECTORY ENTRY FOR DATABASE
             |      |     GET DCS DIRECTORY ENTRIES
             |      |     OPEN DCS DIRECTORY SCAN
             |      |     UNCATALOG DCS DIRECTORY ENTRY
-------------+------+--------------------------------------------------
 delet.sqb   |      |Uses static SQL to delete items from a database.
-------------+------+--------------------------------------------------
 dynamic.sqb |      |Demonstrates the use of a "CURSOR" using dynamic
             |      |SQL.
-------------+------+--------------------------------------------------
 ebcdicdb.cbl|      |Demonstrates the use of the following APIs to
             |      |simulate the collating behavior of a DB2 for
             |      |MVS/ESA CCSID 037 (EBCDIC US English)
             |      |collating sequence:
             |      |     CREATE DATABASE
             |      |     DROP DATABASE
-------------+------+---------------------------------------------------
 expsamp.sqb |      |Demonstrates the use of the following APIs:
             |      |     EXPORT
             |      |     IMPORT
             |      |in conjunction with a DRDA database.
-------------+------+--------------------------------------------------
 impexp.sqb  |      |Demonstrates the use of the following APIs:
             |      |     EXPORT
             |      |     IMPORT
-------------+------+--------------------------------------------------
 inpcli.sqb  | CLI  |Demonstrates stored procedures using the SQLDA
             |      |structure.  This is the client program of a
             |      |client/server example.  (The server program is
             |      |called inpsrv.sqb.)  The program fills the SQLDA
             |      |with information, and passes it to the server
             |      |program for further processing.  The SQLCA status
             |      |is returned to the client program.  This program
             |      |uses an embedded SQL CALL statement to call a
             |      |stored procedure.
-------------+------+--------------------------------------------------
 inpsrv.sqb  | STP  |Demonstrates stored procedures using the SQLDA
             |      |structure.  This is the server program of a
             |      |client/server example.  (The client program is
             |      |called inpcli.sqb.)  The program creates a table
             |      |("PRESIDENTS") in the "SAMPLE" database with the
             |      |information received in the SQLDA.  The server
             |      |program does all the database processing and
             |      |returns the SQLCA status to the client program.
-------------+------+--------------------------------------------------
 joinsql.sqb |      |An example using advanced SQL join expressions.
-------------+------+--------------------------------------------------
 loadqry.sqb |      |Demonstrates how APIs are implemented in order
             |      |to query the current status of a LOAD being 
             |      |invoked on the table "TABLE" in the database 
             |      |"SAMPLE".
-------------+------+--------------------------------------------------
 lobeval.sqb |      |Demonstrates the use of deferring the evaluation
             |      |of a LOB within a database.
-------------+------+--------------------------------------------------
 lobfile.sqb |      |Demonstrates the use of LOB file handles.
-------------+------+--------------------------------------------------
 lobloc.sqb  |      |Demonstrates the use of LOB locators.
-------------+------+--------------------------------------------------
 migrate.cbl |      |Demonstrates the use of the following API:
             |      |     MIGRATE DATABASE
-------------+------+--------------------------------------------------
 monreset.cbl|      |Demonstrates the use of the follwing API:
             |      |     RESET DATABASE SYSTEM MONITOR DATA AREAS
-------------+------+--------------------------------------------------
 monsz.cbl   |      |Demonstrates the use of the following APIs:
             |      |     ESTIMATE DATABASE SYSTEM MONITOR BUFFER SIZE
             |      |     DATABASE SYSTEM MONITOR SNAPSHOT
-------------+------+--------------------------------------------------
 nodecat.cbl |      |Demonstrates the use of the following APIs:
             |      |     CATALOG NODE
             |      |     CLOSE NODE DIRECTORY SCAN
             |      |     GET NEXT NODE DIRECTORY ENTRY
             |      |     OPEN NODE DIRECTORY SCAN
             |      |     UNCATALOG NODE
-------------+------+--------------------------------------------------
 openftch.sqb|      |Uses static SQL to fetch rows and then UPDATE
             |      |or DELETE them.
-------------+------+--------------------------------------------------
 outcli.sqb  | CLI  |Demonstrates stored procedures using the SQLDA
             |      |structure.  This is the client program of a
             |      |client/server example.  (The server program is
             |      |called outsrv.sqb)  This program allocates and
             |      |initializes a one variable SQLDA, and passes it
             |      |to the server program for further processing.
             |      |The filled SQLDA is returned to the client
             |      |program along with the SQLCA status.  This
             |      |uses an embedded SQL CALL statement to call
             |      |a stored procedure.
-------------+------+--------------------------------------------------
 outsrv.sqb  | STP  |Demonstrates stored procedures using the SQLDA
             |      |structure.  This is the server program of a
             |      |client/server example.  (The client program is
             |      |called outcli.sqb)  The program fills the SQLDA
             |      |with the median "SALARY" of the employees in the
             |      |"STAFF" table of the "SAMPLE" database.  The
             |      |server program does all the database processing
             |      |(finding the median).  The server program returns
             |      |the filled SQLDA and the SQLCA status to the
             |      |client program.
-------------+------+--------------------------------------------------
 prepbind.sqb|      |Demonstrates the use of the following APIs:
             |      |     BIND
             |      |     PRECOMPILE PROGRAM
-------------+------+--------------------------------------------------
 qload.sqb   |      |Demonstrates the use of the LOAD QUERY API
-------------+------+--------------------------------------------------
 rebind.sqb  |      |Demonstrates the use of the REBIND API
-------------+------+--------------------------------------------------
 restart.cbl | SRV  |Demonstrates the use of the following API:
             |      |     RESTART DATABASE MANAGER
-------------+------+--------------------------------------------------
 setact.cbl  |      |Demonstrates the use of the following API:
             |      |     SET ACCOUNTING STRING
-------------+------+--------------------------------------------------
 static.sqb  |      |Uses static SQL to retrieve information.
-------------+------+--------------------------------------------------
 sws.cbl     |      |Demonstrates the use of the following API:
             |      |     DATABASE MONITOR SWITCH
-------------+------+--------------------------------------------------
 tabscont.sqb|      |Demonstrates the use of the following APIs:
             |      |     TABLESPACE CONTAINER QUERY
             |      |     OPEN TABLESPACE CONTAINER QUERY
             |      |     FETCH TABLESPACE CONTAINER QUERY
             |      |     CLOSE TABLESPACE CONTAINER QUERY
             |      |     SET TABLESPACE CONTAINER QUERY
-------------+------+--------------------------------------------------
 tabspace.sqb|      |Demonstrates the use of the following APIs:
             |      |     TABLESPACE QUERY
             |      |     SINGLE TABLESPACE QUERY
             |      |     OPEN TABLESPACE QUERY
             |      |     FETCH TABLESPACE QUERY
             |      |     GET TABLESPACE STATISTICS
             |      |     CLOSE TABLESPACE QUERY
-------------+------+--------------------------------------------------
 tabsql.sqb  |      |An example using advanced SQL table expressions.
-------------+------+--------------------------------------------------
 tload.sqb   | SRV  |Demonstrates the use of the following APIs:
             |      |     EXPORT
             |      |     QUIESCE TABLESPACES FOR TABLE
             |      |     LOAD
-------------+------+--------------------------------------------------
 trigsql.sqb |      |An example using advanced SQL triggers and
             |      |contraints.
-------------+------+--------------------------------------------------
 tspace.sqb  |      |Demonstrates the use of the following APIs:
             |      |     COPY MEMORY
             |      |     FREE MEMORY
             |      |     TABLESPACE QUERY
             |      |     TABLESPACE CONTAINER QUERY
             |      |     SINGLE TABLESPACE QUERY
             |      |     OPEN TABLESPACE QUERY
             |      |     FETCH TABLESPACE QUERY
             |      |     CLOSE TABLESPACE QUERY
             |      |     OPEN TABLESPACE CONTAINER QUERY
             |      |     FETCH TABLESPACE CONTAINER QUERY
             |      |     CLOSE TABLESPACE CONTAINER QUERY
             |      |     SET TABLESPACE CONTAINERS
             |      |     GET TABLESPACE STATISTICS
-------------+------+--------------------------------------------------
 updat.sqb   |      |Uses static SQL to update a database.
-------------+------+--------------------------------------------------
 varinp.sqb  |      |An example of variable input to Embedded Dynamic
             |      |SQL calls using parameter markers.
-------------+------+--------------------------------------------------


-------------+------+---------------------------------------------------
 COMMAND     |NOTES | DESCRIPTION
 FILE        |      |
 NAME        |      |
-------------+------+--------------------------------------------------
 bldvcapi    |      |Builds a sample Cobol program that contains DB2 APIs
             |      |(IBM VisualAge Cobol).
-------------+------+---------------------------------------------------
 bldvacob    |      |Builds a sample Cobol program that contains embedded SQL
             |      |(IBM VisualAge Cobol).
-------------+------+---------------------------------------------------
 bldvacbs    |      |Builds a sample Cobol stored procedure into a shared library
             |      |(IBM VisualAge Cobol).
-------------+------+---------------------------------------------------
 embprep     |      |Preps and binds an IBM VisualAge for COBOL program.
-------------+------+---------------------------------------------------


-------------+------+---------------------------------------------------
 OTHER       |NOTES | DESCRIPTION
-------------+------+--------------------------------------------------
 makefile    |      |Builds most of the supplied programming examples in
             |      |the "sqllib\samples\cobol" subdirectory.
-------------+------+---------------------------------------------------
 README      |      |Lists and describes at a high-level, all files in
             |      |the "sqllib\samples\cobol" sub-directory. (This file).
-------------+------+---------------------------------------------------