Chapter 2: Product Specifications

DB2 Universal Database is basically compatible with DB2 for OS/390, with some exceptions in DML syntax and functions supported and certain DDL statements that are hardware/operating system specific. Host Compatibility Option tries to address some of the main areas of incompatibility where possible by converting DB2 for OS/390 SQL statements to supported DB2 UDB syntax.

Additional compatibility is possible when using DB2 for OS/390 database servers via the DB2 Connect product.

2.1 HCO Functions

Host Compatibility Option provides the following functions:

2.2 DDL DB2 for OS/390 Syntax Supported

As stated previously, the Host Compatibility Option pre-processor and DDL processor are designed to handle DDL statements that use DB2 for OS/390 syntax. Functions can be processed in one of the following ways:

Sometimes it is better to perform the function manually.

2.2.1 Functions Processed Unchanged

The following is a list of functions that are not modified or changed since they are supported by DB2 Universal Database V7.2 or later:

2.2.2 Functions Changed to Comments

DB2 Universal Database does not use STOGROUP when creating databases and tables. Therefore, this syntax is changed to comments. Some syntax such as TABLESPACE is supported by DB2 Universal Database but the usage is machine specific depending on the type of DB2 server being used so this syntax is also removed. Other functions, such as DROP DATABASE can be done using other DDL Processor options.

The following is a list of functions that are changed to comments:

2.2.3 Functions That May Be Modified

Host Compatibility Option auto-senses which SQL engine it is running with. In addition, certain options such as FIELDPROC are not supported under DB2 Universal Database. Consequently, all columns defined with this option must be modified. The following is a list of functions that are supported and modifications are made to statements as needed to run under DB2 Universal Database:

For example, the ALTER TABLE statement has the following syntax and options:

ALTER TABLE table-name  
    ADD column-name data-type FIELDPROC
    (program-name or constant)
    ADD column-name data-type NOT NULL WITH DEFAULT VALIDPROC
      program or NULL
    AUDIT NONE or CHANGES or ALL
    PRIMARY KEY ( column-name )
    FOREIGN KEY constraint-name ( column-name )
    REFERENCES table-name ON DELETE
    RESTRICT or CASCADE or SET NULL
    DROP PRIMARY KEY
    DROP FOREIGN KEY constraint-name

The options FIELDPROC, VALIDPROC and AUDIT are not supported by DB2 Universal Database and would be removed from the statement. The rest of the statement is supported unchanged.

Similarly, the CREATE INDEX statement has the following syntax and options:

CREATE unique INDEX index-name
ON table-name
    ( column-name ASC or DESC )
    USING VCAT catalog-name
    USING STOGROUP stogroup-name
    PRIQTY integer SECQTY integer
    ERASE no or yes
    FREEPAGE integer
    PCTFREE integer
    CLUSTER ( PART integer VALUES (constant )
    or using-block or free-block )
    SUBPAGES 1 or 2 or 4 or 8 or 16 
    BUFFERPOOL BP0 or BP1 or BP2
    CLOSE yes or no 
    DSETPASS password

The options USING VCAT, USING STOGROUP, FREEPAGE, PCTFREE, CLUSTER, SUBPAGES, BUFFERPOOL, CLOSE and DSETPASS are not supported under DB2 Universal Database and therefore will be removed from the command that is passed to DB2 Universal Database.

In the CREATE TABLE statement, the syntax and options are as follows:

CREATE TABLE table-name
     ( column-definition data-type FIELDPROC
    program-name or constants
    , column-definition data-type NOT NULL
    , column-definition data-type NOT NULL WITH DEFAULT
    , PRIMARY KEY (column-name)
    , FOREIGN KEY constraint-name ( column-name )
         REFERENCES table-name
         ON DELETE RESTRICT or CASCADE or SET NULL
    LIKE table-name or view-name )
    IN DATABASE database-name
    IN database-name.tablespace-name
    EDITPROC program-name
    VALIDPROC program-name
    AUDIT NONE or CHANGES or ALL

The options FIELDPROC, LIKE, IN DATABASE, EDITPROC and VALIDPROC are not supported by DB2 Universal Database.

2.3 DB2 Universal Database Syntax DDL

HCO can also process DDL statements in DB2 Universal Database syntax without modifying the statements. See the chapter DDL Processor for more details on how to do this.

2.4 Features Supported by DB2 Universal Database

DB2 Universal Database supports a number of DB2 for OS/390 functions, scalars and special registers.

2.4.1 Column Functions and Scalars

DB2 Universal Database supports Date and Time arithmetic and the following Scalar and Column functions:

2.4.2 Special Registers

DB2 Universal Database supports the following special registers:

See your DB2 Universal Database SQL Reference for details on any additional special registers that may be supported.

2.5 Features Unsupported in DB2 Universal Database

DB2 Universal Database is not completely DML compatible with DB2 for OS/390 v6.1.

2.5.1 Special Registers

DB2 Universal Database does not support the following special register:

You can set the current packageset but IBM has not implemented this as a special register.

2.5.2 Other Functions

DB2 Universal Database does not support the following statements:

Some SQL syntax especially dealing with stored procedures is supported by DB2 UDB via other languages such as C++ or JAVA but has not been implemented using COBOL.

For additional information about coding and testing stored procedures and supported/not supported features, see Stored Procedures.


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