COBOL to Java mapping

When you generate a XOM from a COBOL copybook most COBOL types map to a Java™ type.

When generating a XOM from a COBOL copybook, the COBOL types are mapped to default Java types.

The following table lists each COBOL type and shows the corresponding COBOL usage and compile options, the PICTURE String with some examples, and the Java type to which the COBOL type maps. Note that not all COBOL types map to a Java type.

COBOL type COBOL usage and compile options PICTURE string Example XOM Java type
Alphabetic DISPLAY A PIC A(20). Not supported
AlphaNumeric DISPLAY

X

Combination of A, X, and 9

PIC X(12). String
AlphaNumericEdited DISPLAY A X 9 B 0 / PIC XBX. Not supported
Numeric

COMP-5 or BINARY, COMP, COMP-4 with TRUNC(BIN).

For the compile option TRUNC(BIN), the range for a binary number (binary, COMP, COMP-4) is constrained by the storage limit, not the PICTURE String.

COMP-5 is always constrained by the storage limit.

The storage limit is determined by the size of the PICTURE String.

S9(1) through 9(4) PIC S9 BINARY. short
    S9(5) through S9(9) PIC S999999 BINARY. int
    S9(10) through S9(18) PIC S9999999999 BINARY. long
    9(1) through 9(4) PIC 9 BINARY. int
    9(5) through 9(9) PIC 999999 BINARY. long
    9(10) through 9(18) PIC 9999999999 BINARY. BigInteger
    9(10) through 9(18), with decimal (V or P) PIC S999V9 BINARY. BigDecimal
  DISPLAY, COMP-3, PACKED-DECIMAL or BINARY, COMP, COMP-4 and not TRUNC(BIN)

S9(1) through S9(4)

9(1) through 9(4)

  short
   

S9(5) through S9(9)

9(5) through 9(9)

  int
   

S9(10) through S9(18)

9(10) through 9(18)

  long
    S9(10) through S9(18) and 9(10) through 9(18), with decimal (V or P)   BigDecimal
  DISPLAY, COMP-3, PACKED-DECIMAL and ARITH(extend)

S9(19) through S9(31)

9(19) through 9(31)

  BigInteger
  DISPLAY, COMP-3, PACKED-DECIMAL and ARITH(extend)

S9(19) through S9(31)

9(19) through 9(31)

Decimal (V or P)

  BigDecimal
NumericEdited DISPLAY B P V Z 9 0 / , . + - CR DB * cs PIC 9B9 Not supported
DBCS DBCS G, B, or N with DISPLAY-1 PIC G(10). String
InternalFloat COMP-1     float
  COMP-2     double
ExternalFloat   +9 -9 0 . V E 9. PIC +99V9E99. Not supported
NationalExternalFloat   PIC +9.9E+99 PIC NBN Not supported
Level 88    
05 TXN_Resp_Code PIC X(3) 
    88 Business_Code value "AAA" through "XXX" 
    88 Business_Error value "XYX" through "ZYX" 
    88 Completed_Code value "COM" 
Accessor for main element is the get method for each Level 88 item
National NATIONAL PIC N(8)   String
   

PIC 999V9

PIC S999V9 SIGN LEADING SEPARATE

PIC S999V9 SIGN TRAILING SEPARATE

  BigDecimal
NationalEdited  

PIC NBN

PIC $9.9

  Not supported