Previous Topic Next topic Print topic


Storage Representation of Parameters

The storage of parameters in mixed language applications, since different systems store data either with the most significant byte first or with it last.
Restriction: The following applies to native COBOL only.

The format in which parameters are stored can vary from one language to another. The following data types have implications for mixed-language programming:

USAGE Storage Representation
COMP-X Data is stored using big-endian byte ordering, where data is stored with the most significant byte first; that is, the most significant byte is at the lowest address. Although this is standard COBOL format, it is the reverse of the Intel standard of storing the most significant byte last (little-endian).
COMP-5 Data is stored in native order. On Intel x86 and little-endian PowerLinux platforms that is little-endian byte ordering, where data is stored with the least significant byte first; that is, the least significant byte is at the lowest address. On all other platforms, that is big-endian byte ordering, where data is stored with the most significant byte first; that is, the most significant byte is at the lowest address.

Using this data type enables you to pass parameters directly from COBOL to non-COBOL programs without parameter conversion.

POINTER and PROCEDURE-POINTER

Pointers are stored in native order.

If the AMODE Compiler directive is in effect, see AMODE for more details; otherwise, the size of a pointer or procedure-pointer is either 4 byte (32-bit platforms) or 8 byte (64-bit platforms).

Pointer variables are extremely useful for holding the address of a dynamically allocated memory area. COBOL programs can then access this memory using the SET ADDRESS statement.

Previous Topic Next topic Print topic