COBOL
This topic lists the data definitions of COBOL that are used by the Data Mapping Facility (DMF) and shows the equivalent SQL data types that are used by IBM Data Virtualization Manager for z/OS.
| Data definition | SQL data type | Host format |
|---|---|---|
|
PIC X(30) PIC A(30) |
SQL_Char | Character |
|
PIC S9(3)V9(3) PIC S9(3)V9(3) USAGE DISPLAY |
SQL_Char | Display Numeric |
| PIC G(30) USAGE DISPLAY-1 | SQL_Graphic (SQL_Unicode) | Graphic (DBCS) |
|
PIC S9(_) USAGE BINARY PIC S9(_) USAGE COMP PIC S9(_) USAGE COMP-4 |
Length 1 to 4 SQL_Smallint Length 5 to 9 SQL_Integer Length 10 to 18 SQL_Binary |
Smallint Integer Binary
Note: Fields with a length of 10 to 18 become SQL_BIGINT when support for BIGINT is
added.
|
| USAGE IS COMP-1 | SQL_Float | Float |
| USAGE IS COMP-2 | SQL_Double | Float |
|
PIC S9(03)V9(3) USAGE COMP-3 PIC S9(03)V9(3) USAGE PACKED-DECIMAL |
SQL_Decimal |
Packed Decimal |
| PIC S9(7)V99 COMP |
SQL_Decimal |
Signed Binary Integer |
| PIC 9(7)V99 COMP |
SQL_Decimal |
Unsigned Binary Integer |
|
PIC S9(_) USAGE COMP-5 PIC 9(_) USAGE COMP-5 |
Length 1 to 4 SQL_Smallint Length 5 to 9 SQL_Integer Length 10 to 18 SQL_Binary |
Smallint Integer Binary
Note: Fields with a length of 10 to 18 become SQL_BIGINT when support for BIGINT is
added.
|
| Picture | Storage representation | Numeric values |
|---|---|---|
| S9(1) through S9(4) S9(5) through S9(9) S9(10) through S9(18) |
Binary half-word (2 bytes) Binary full-word (4 bytes) Binary double-word (8 bytes) |
-32768 to +32767 -2,147,483,648 to +2,147,483,647 -9,223,372,036,854,775,808 to +9.223,372,036,854,775,807 |
| Picture | Storage representation | Numeric values |
|---|---|---|
| 9(1) through 9(4) 9(5) through 9(9) 9(10) through 9(18) |
Binary half-word (2 bytes) Binary full-word (4 bytes) Binary double-word (8 bytes) |
0 to 65535 0 to 4,294,967,295 0 to 18,446,744,073,709,551,615 |