What are COBOL equivalents of DB2 data types CHAR, DATE, TIME and TIMESTAMP?



The DATE, TIME and TIMESTAMP DB2 data types occupy 4, 3 and 10 bytes respectively. The memory occupied by the CHAR data types is occupied as per the size given. Below table shows the equivalent COBOL data types for CHAR, DATE, TIME and TIMESTAMP.

DB2 data type DB2 Bytes COBOL equivalent COBOL bytes
CHAR(z) z PIC X(z) z
DATE 4 PIC X(10) 10
TIME 3 PIC X(8) 8
TIMESTAMP 10 PIC X(26) 26
Updated on: 2020-09-14T11:15:06+05:30

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements