Coding interoperable data types in COBOL and Java
Your COBOL program can use only certain data types when communicating with Java™.
About this task
Primitive Java data type | Corresponding COBOL data type |
---|---|
boolean1 | PIC X followed by exactly two
condition-names of this form:
|
byte1 | Single-byte alphanumeric: PIC X or PIC
A |
short | USAGE BINARY , COMP , COMP-4 ,
or COMP-5 , with PICTURE clause of
the form S9(n) , where 1<=n<=4 |
int | USAGE BINARY , COMP , COMP-4 ,
or COMP-5 , with PICTURE clause of
the form S9(n) , where 5<=n<=9 |
long | USAGE BINARY , COMP , COMP-4 ,
or COMP-5 , with PICTURE clause of
the form S9(n) , where 10<=n<=18 |
float2 | USAGE COMP-1 |
double2 | USAGE COMP-2 |
char | Single-character elementary national: PIC
N USAGE NATIONAL . (Cannot be a national group.) |
class types (object references) | USAGE OBJECT REFERENCE class-name |
|