Compiling DB2 Programs with HCO

The DB2 External Compiler Module allows programs checked with CHARSET(EBCDIC) directive to access SQL tables using DB2 LUW. The DB2 ECM generates code to convert all character data (columns defined as CHAR or VARCHAR) from EBCDIC to ANSI before storing it in DB2 LUW tables and conversely converts it from ANSI to EBCDIC on all retrievals from DB2 LUW tables.

This means that other products such as Microsoft Excel can still be used to access data stored in the tables.

Note: The only time the DB2 ECM may have problems is where character columns are defined as being FOR BIT DATA. The data stored in the column is not necessarily ANSI character data to begin with. In this case, the DB2 ECM still generates the code to convert the column. Therefore, results can be unpredictable.