Creating a DB2 LUW Database for HCO

COBOL applications written using a mainframe COBOL dialect require that any DB2 LUW database accessed by such an application use an EBCDIC collating sequence. The HCO Create Database Tool enables you to create a compatible DB2 LUW database on a Windows or UNIX platform for access from a COBOL application coded using a mainframe COBOL dialect.

Note: The HCO Create Database tool provides seamless integration with mainframe COBOL-dialect applications that use SBCS (single-byte character sets) only, regardless of the platform. To create a database to be accessed from an application that uses DBCS (double-byte character sets), see the IBM documentation that covers database creation and appropriate EBCDIC collating sequences.

The Create Database Tool is available from the HCO for DB2 LUW user interface (Windows only) , or using the mfhco create (Windows) or cobmfhco create (UNIX) . See the mfhco and cobmfhco create commands and To create a database topics for additional details.

Set MFCODESET to a country code

Before using the Create Database tool to create a database, set the MFCODESET environment variable to an appropriate country code value listed on the Supported Country Codes topic. A correct setting of MFCODESET ensures that the database EBCDIC collating sequence matches the CHARSET EBCDIC behavior of your application. The correct code for a given country could vary depending on your platform and whether or the database requires Euro (€) character translation enablement.

Windows platforms
Create DB2 LUW databases on Windows platforms using code page 1252 for both Euro and non-Euro character translations. To determine the country code, use the first table listed on the Supported Country Codes topic.
UNIX platforms
On UNIX platforms, create databases requiring Euro character translation enablement using code page 923, and databases that do not require Euro character translation enablement using code page 819. To determine the country code, use the second table listed on the Supported Country Codes topic.
Important: IBM does not always support the creation of a UNIX database from a Windows environment when using code page 923. In light of this, we recommend that you create UNIX DB2 LUW databases that do require Euro enablement, on a UNIX machine using the UNIX cobmfhco create command-line tool.

Determine the code page

You can determine which code page was used to create an existing database by connecting to the database, starting a DB2 command prompt, and issuing a get db config command. See the IBM GET DATABASE CONFIGURATION command documentation for details.

The following is an example of get db config output showing a Database code page of 1252:

C:\Program Files\IBM\SQLLIB\BIN>db2 get db config
       Database Configuration for Database
 Database configuration release level                    = 0x1400
 Database release level                                  = 0x1400

 Database territory                                      = En_US
 Database code page                                      = 1252
 Database code set                                       = 1252
 Database country/region code                            = 1
 Database collating sequence                             = UNIQUE
 Alternate collating sequence              (ALT_COLLATE) =
 Number compatibility                                    = OFF
 Varchar2 compatibility                                  = OFF