Migration of 32-bit applications to 64-bit mode

Execution results can change in 64-bit mode. If you migrate 32-bit applications to 64-bit mode, you might need to do some recoding to accommodate the differences.

Although the main consideration in migrating to 64-bit mode is the change in size of data items, other areas of an application could potentially be impacted, as described below.

LENGTH OF special register:

In 32-bit mode, the implicit definition of the LENGTH OF special register is PICTURE 9(9) USAGE IS BINARY. In 64-bit mode, the implicit definition is PICTURE 9(18) USAGE IS BINARY.

LENGTH intrinsic function:

In 32-bit mode, FUNCTION LENGTH returns a 9-digit integer. In 64-bit mode, it returns an 18-digit integer.

Address data items and index data items:

The storage allocation for data items that contain addresses or indexes is 4 bytes in 32-bit mode, and 8 bytes in 64-bit mode. The data items that are affected are those that are defined with any of the following usages:

The special registers ADDRESS OF and JNIEnvPtr are implicitly defined as USAGE POINTER. Therefore storage is allocated for them as described above for USAGE POINTER data items.

Layout of group items:

The change in allocation size of address data items and index data items between 32-bit mode and 64-bit mode programs, described above, affects the layout of group items. In particular, data items that are located after an address or index data item could be located at different offsets within a group. The number of slack bytes (bytes inserted by the compiler to ensure correct alignment) could differ, and thus the total size of a group could change.

SYNCHRONIZED data items:

If the SYNCHRONIZED clause is specified for address data items or index data items, the items are aligned on a fullword boundary in 32-bit mode and on a doubleword boundary in 64-bit mode. Offsets of data items within a group, number of slack bytes, and total group size could change, as described above for group items.

Data files:

Data files created by 32-bit mode programs can be processed by 64-bit mode programs, and data files created by 64-bit mode programs can be processed by 32-bit mode programs. No addressing mode is attached to a data file. However, if a record definition contains an address data item or index data item, migration to 64-bit mode could cause the length of the record, and thus the length of the file, to change.

Middleware subsystems:

If a program depends on a middleware subsystem to do data-processing tasks, make sure that that subsystem works with 64-bit programs.

Restriction: CICS TXSeries supports only 32-bit COBOL applications.

DB2 Version 9 supports either 32-bit or 64-bit COBOL applications.

Other considerations:

AIX does not support mixing 32-bit mode and 64-bit mode programs within an application, and the linker does not support linking object files of different addressing modes. If a 64-bit program makes interlanguage calls, or calls routines in a user library, make sure that 64-bit versions of the called routines are available.

related references  
ADDR  
Data size limits  
Compiler limits (COBOL for AIX Language Reference)