Chapter 15: Migrating from Host Compatibility Option

The equivalent in Mainframe Express of the Micro Focus Host Compatibility Option (HCO) add-on for Workbench is also called Host Compatibility Option. It is an option that adds Host Compatibility Option support to the IDE, and is based on the Host Compatibility Option for Workbench. This chapter describes differences between the Workbench HCO and Mainframe Express Host Compatibility Option that might require you to make alterations in existing applications that you are migrating, or to change familiar methods of working.

15.1 Overview

Host Compatibility Option in Mainframe Express enables you to access IBM DB2 databases on the mainframe and to create DB2-compatible databases on your workstation.

Mainframe Express supports Host Compatibility Option only for emulating DB2. It does not support Oracle, Sybase and Informix.

15.2 Details

This section advises on what to use where a feature in Host Compatibility Option for Workbench is not in Mainframe Express or has changed. Where we believe you can continue using a feature without change, it is not mentioned. This book does not cover enhancements.


15.2.1 SQL Directive

Directive to enable support for IBM DB2 databases.

Status in Mainframe Express:

Replaced by the DB2 directive. You must have installed Mainframe Express's Host Compatibility Option to provide the support.

To migrate your application:

Wherever you used the SQLDB or SQL directive, use the DB2 directive. Workbench has new and old forms of the SQL directive, for example SQLDB(SAMPLE) and SQL(DB=SAMPLE), which are equivalent. The DB2 directive in Mainframe Express uses the new form, for example DB2(DB=SAMPLE).


15.2.2 Compiling a Program That Uses a Remote Database

Ability to compile a program that uses a remote database by specifying the SQL(PASS=user.password) directive.

Status in Mainframe Express:

Replaced by alternative methods of connecting to a remote database. For further details see the section Compiling Programs That Use a Remote DB2 Server in the chapter DB2 External Compiler Module in the Host Compatibility Option Technical Guide.


15.2.3 DB2CSR Preprocessor Directive

Directive to convert dashes in cursor names to underscores.

Status in Mainframe Express:

Not needed, as Mainframe Express Host Compatibility Option automatically converts dashes in cursor names to underscores.


15.3 Frequently Asked Questions

This section answers questions that may arise in the course of migrating.


15.3.1 Why does NLS data I stored in DB2/2, using the HCO add-on to Workbench, sometimes appear wrong in Mainframe Express?

Mainframe programs expect EBCDIC data, but DB2/2 stores data using the PC character set. So Host Compatibility Option converts between the two character sets whenever you access a database. But the HCO add-on to Workbench and Host Compatibility Option in Mainframe Express use different PC character sets - the former uses ASCII and the latter uses ANSI. These two character sets are mostly the same, except for some special characters and NLS characters.

If you come across this problem, you need to convert your DB2/2 data from ASCII to ANSI. You can use a standard utility, DSNTIAUL, provided with Host Compatibility Option for importing data from EBCDIC and exporting to EBCDIC. Use it as follows:

  1. In Workbench+HCO, use DSNTIAUL to export the DB2/2 table containing your ASCII data.

    This converts the data from ASCII to EBCDIC.

    If the data that appears wrong is used in key data or sort sequences, the database and tables must be re-created. If not, you can skip steps 2 and 3.

  2. Create a new database using Mainframe Express+Host Compatibility Option - click HCO on the Tools menu, then click Create Database and use the Micro Focus codepage.

    This causes DB2 to use the Micro Focus ANSI codeset for all sorting and result sets where data is collated.

  3. Re-create the tables in the database using Mainframe Express+Host Compatibility Option - click HCO on the Tools menu, then click DDL Processor.

  4. In Mainframe Express+Host Compatibility Option, use DSNTIAUL to import the dataset produced.

    This converts the data from EBCDIC to ANSI.


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