Created On:  11th July 2012

Problem:

Application uses cobol application on linux platform and database db2 for z/os on mainfarme.

Cobol application communicates to database server with db2 connect.

Application uses compile directive CHARSET=ASCII.

There is a problem calling db2 if we use host-variables that contain the HIGH-VALUE character (X'FF').

This character is converted into EBCDIC character X('9F').

For example
sql BETWEEN from LOW-VALUE (x'00') and HIGH-VALUE (X'FF'),

db2 z/os executes the BETWEEN from LOW-VALUE(X'00) and X'9F'.
In EBCDIC the character X'9F' isn't the largest, and the BETWEEN result isn't correct.

We have tried to set the same CODEPAGE from db2 client and db2 server, but we haven't tried to use the CHARSET=EBCDIC because we are using Server Express 5.1 WP 6 and need to use MFHCO - is MFHCO available Server Express 5.1 WP6 (since it doesn't support MTO)?

The following error is seen:
cob64: error(s) in compilation: sigt504.cob

This is on a 64 bit system

Resolution:

Although DB2/ECM is supported in 64bit mode (as well as 32bit mode) on some platforms, HCO is only supported in 32 bit mode.

Hence the error being reported by 'cob64':
cob64: error(s) in compilation: sigt504.cob

You should have COBMODE 32 set for HCO.


Please also check the following steps/points:

1. If you can maintan the same character set then you shouldn't run into this type of problem (otherwise, you may need to develop a conversion program that reads the information from the EBCDIC environment, converts it correctly and then inserts it into the ASCII environment).

2. You may also need to take account of the codepage that the db2 is using - if you can set this to be the same codepage as your application then again you shouldn't run into this problem

3. You can compile your programs with CHARSET"EBCDIC" if you want to run them in EBCDIC.

4. See the following KB Articles:
14031: Collating sequence issues in Enterprise Server JCL with UDB
33342: How to change the definition of HIGH-VALUES

5. Server Express 5.1 WP6 was provided with the following information:
"This update is not available to Studio Enterprise Edition 5.1 customers using CICS, IMS or JCL functionality. The latest 5.1 WrapPack that supports CICS, IMS or JCL is WrapPack 5."
WP6 shouldn't be applied to any MTO system.

6. UNIX Requirements
To run HCO tools under UNIX, the user ID under which the HCO tools are executed must have BINDADD or SYSADM permissions on the database.
To successfuly compile DB2 applications with the CHARSET(EBCDIC) directive, you must configure your environment to enable HCO support by setting the MFHCO environment variable to YES.
For example:
MFHCO=YES
export MFHCO

http://documentation.microfocus.com/help/index.jsp
[Micro Focus Developer > Server Express Remote Development Option > Programming > Database Access > Host Compatibility Option Technical Guide > Introducing HCO > Host Compatibility Option Overview]

7. There may be a discrepency in the codepages for the Dbase and the ES server. You can set the environment variable "DB2CODEPAGE=..." to set the codepage to that of the database prior to starting the Enterprise Server. Alternatively, redefine the database to use the (native) codepage of the ES.
For more information regarding DB2 and codepages reference see the IBM documentation at http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsptopic=/com.ibm.db2.udb.doc/ad/c0006825.htm.

8. Note that even with a UNICODE (or other) codepage, it is usual to designate an EBCDIC collating sequence for the benefit of any SQL ORDER BY clauses from Micro Focus COBOL programs. 

2577965