64-bit applications in the .NET environment

.NET COBOL applications running on a 64-bit platform can use either the 32-bit or the 64-bit Common Language Runtime (CLR).

The default setting for the project's property Platform Target is AnyCPU. This means that on a 64-bit computer the 64-bit CLR is used and on a 32-bit computer the 32-bit CLR is used. You can also specify in the Platform Target that a specific bitism should be used such as x86 for 32-bit or x64 for 64-bit.

Note: When compiling for .NET using SQL(DBMAN=ODBC), set the Platform Target to either x86 or x64 which corresponds to the bitism of the ODBC driver you are using.

Most COBOL programs can run on 64-bit systems without recompilation. However, there are some cases where you need to ensure that COBOL pointer items in your application are allocated as 64 bits in size rather than the default of 32 bits. To do this you set the project property Generate 64-bit Pointers.

You need to generate 64-bit pointers when:

  • The combined data of all the programs in your application requires more than a 32-bit address space
  • Your .NET COBOL is calling native COBOL on the 64-bit CLR and the .NET COBOL is passing parameters that contain structures with pointers

If your application uses native COBOL code, and you need to execute that code on a 64-bit CLR, you need to ensure it is recompiled to target the appropriate 64-bit processor.