Table 1 shows the correspondence between COBOL type declarations and logical data model data types.
COBOL type | Logical data model type | Description |
---|---|---|
PIC X(10) |
CHAR(10) |
Alphanumeric characters |
PIC A(5) |
CHAR(5) |
Alphabetic characters (A-Z and blank) |
PIC G(10) |
CHAR(10) |
Double-byte characters |
PIC B(5) |
CHAR(5) |
Editable characters |
PIC 9(18) |
DECIMAL(18,0) |
18-digit numeric characters (0-9) (maximum limit) |
PIC 99V99 |
DECIMAL(4,2) |
Decimal (for example, 12.25) |
PIC S99V9 |
DECIMAL(3,1) |
Decimal (for example, 12.9) |
PIC ----,--9.99 |
CHAR(9) |
Generally used as output display only |
PIC ++++,++9.99 |
CHAR(11) |
Generally used as output display only |
PIC +z,zz9.99 |
CHAR(9) |
Generally used as output display only |
PIC $***,**9.99CR |
CHAR(13) |
Generally used as output display only |
01 CUST-NAME 05 PIC X(20) 05 PIC X(20) |
CUST-NAME (Entity) CHAR(20) CHAR(20) |
COBOL record that is transformed to an entity with two attributes in the logical data model |