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 64-bit CLR is used by default. This corresponds to setting the project property Platform Target to AnyCPU. To use the 32-bit CLR, you set the Platform Target to a 32-bit platform.

Note: When compiling for .NET using SQL(DBMAN=ODBC), set the Platform Target to specify the appropriate platform.

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 managed COBOL is calling native COBOL on the 64-bit CLR and the managed 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.