Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Data representation

The representation of data can differ between IBM host COBOL and IBM COBOL for Windows.

Binary data

COBOL for Windows handles binary data types based on the setting of the BINARY compiler option.

Do not specify the zSeries formats of binary data items as arguments on INVOKE statements or as method parameters. You must specify these arguments and parameters in the native formats in order for them to be interoperable with the Java data types.

Zoned decimal data

Sign representation for zoned decimal data is based on ASCII or EBCDIC depending on the setting of the CHAR compiler option (NATIVE or EBCDIC) and whether the USAGE clause is specified with the NATIVE phrase. COBOL for Windows processes the sign representation of zoned decimal data consistently with the processing that occurs on the host when the compiler option NUMPROC(NOPFD) is in effect.

Packed-decimal data

Sign representation for unsigned packed-decimal numbers is different between COBOL for Windows and host COBOL. COBOL for Windows always uses a sign nibble of x'C' for unsigned packed-decimal numbers. Host COBOL uses a sign nibble of x'F' for unsigned packed-decimal numbers. If you are going to share data files that contain packed-decimal numbers between Windows and z/OS, it is recommended that you use signed packed-decimal numbers instead of unsigned packed-decimal numbers.

Display floating-point data

You can use the FLOAT(S390) compiler option to indicate that display floating-point data items are in the zSeries data representation (hexadecimal) as opposed to the native (IEEE) format.

Do not specify the zSeries formats of display floating-point items as arguments on INVOKE statements or as method parameters. You must specify these arguments and parameters in the native formats in order for them to be interoperable with the Java data types.

National data

COBOL for Windows uses UTF-16 little-endian format for national data. Host COBOL uses UTF-16 big-endian format for national data.

EBCDIC and ASCII data

You can specify the EBCDIC collating sequence for alphanumeric data items using the following language elements:

You can specify the CHAR(EBCDIC) compiler option to indicate that DISPLAY data items are in the zSeries data representation (EBCDIC).

Code-page determination for data conversion

For alphabetic, alphanumeric, DBCS, and national data items, the source code page used for implicit conversion of native characters is determined from the locale in effect at run time.

For alphanumeric, DBCS, and national literals, the source code page used for implicit conversion of characters is determined from the locale in effect at compile time.

DBCS character strings

Under COBOL for Windows, ASCII DBCS character strings are not delimited with the shift-in and shift-out characters except possibly with the dummy shift-in and shift-out characters as discussed below.

Use the SOSI compiler option to indicate that Windows-based workstation shift-out (X'1E') and shift-in (X'1F') control characters delimit DBCS character strings in the source program, including user-defined words, DBCS literals, alphanumeric literals, national literals, and comments. Host shift-out and shift-in control characters (X'0E' and X'0F', respectively) are usually converted to workstation shift-out and shift-in control characters when COBOL for Windows source code is downloaded, depending on the download method that you use.

Using control characters X'00' through X'1F' within an alphanumeric literal can yield unpredictable results.

related tasks
Setting the locale
Fixing differences caused by data representations

related references
CHAR
SOSI


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)