Previous Topic Next topic Print topic


Type Compatibility of Managed COBOL with Other Managed Languages

Many managed COBOL types have a strict correspondence with managed types in other languages, such as binary-long and float-short. For those that don't have a correspondence, there are alternatives.

The following table lists the correspondence between managed COBOL types and classes and types in other managed languages.

Managed COBOL .NET class JVM type C# type Description
Integer types:
binary-char System.SByte byte sbyte An 8-bit signed integer

Not CLS-compliant

binary-char unsigned System.Byte byte An 8-bit unsigned integer
binary-short System.Int16 short short A 16-bit unsigned integer

Not CLS-compliant

binary-short unsigned System.UInt16 ushort A 16-bit signed integer
binary-long System.Int32 int int A 32-bit signed integer
binary-long unsigned System.UInt32 uint A 32-bit unsigned integer

Not CLS-compliant.

binary-double System.Int64 long long A 64-bit signed integer
binary-double unsigned System.UInt64 ulong A 64-bit unsigned integer

Not CLS-compliant

Floating point types:
float-short System.Single float float A single-precision (32-bit) floating-point number
float-long System.Double double double A double-precision (64-bit) floating-point number
Logical Types:
condition-value System.Boolean boolean bool A boolean value (true or false)
Other types:
System.Char char char A unicode (16-bit) character
System.Decimal decimal A 96-bit decimal value
System.IntPtr A signed integer whose size depends on the underlying platform (a 32-bit value on a 32-bit platform and a 64-bit value on a 64-bit platform)
System.UIntPtr An unsigned integer whose size depends on the underlying platform (a 32- bit value on a 32-bit platform and a 64-bit value on a 64-bit platform)

Not CLS-compliant

Class objects:
System.Object java.lang.Object object The root of the object hierarchy
System.String java.lang.String string An immutable, fixed-length string of Unicode characters
Previous Topic Next topic Print topic