Created On:  22 March 2011

Problem:

A customer is using COMP-5 fields in their mainframe COBOL programs. These are compiled using ENTCOBOL dialect.  They are finding issues due the byte ordering differences (little-endian/big-endian) between MFE on Windows and the mainframe.  I’ve suggested the compiler directive “COMP5-BYTE-ORDER"PORTABLE" as a possible workaround, but the documentation says that this cannot be used with SQL programs.

The customer uses XDB, will this be a problem?  If so what would be a solution for the COMP-5 issue?

Resolution:

This shouldn't be an issue when using the XDB ECM (the Micro Focus SQL precompiler). The ECM runs as another module within the compiler and is made aware by the compiler that the host variables are big-endian when the COMP5-BYTE-ORDER"PORTABLE" directive is in effect.

If you are referring to the use of other vendors SQL precompilers, because those run outside of the compiler, they will interpret COMP-5 as NATIVE endian.  This would be a problem when using COBOL code that expects big-endian data while running on a little-endian platform.
Incident #2508253