What are COBOL equivalents of DB2 data types SMALLINT, INTEGER and DECIMAL?


The DCLGEN utility converts the table column from DB2 data types to host variables having equivalent COBOL data types. The SMALLINT and INTEGER is converted to COBOL signed numeric data types and DECIMAL is converted to COBOL signed numeric with implied decimal. Below are the equivalent COBOL data types for SMALLINT, INTEGER and DECIMAL.

DB2 data typeDB2 BytesCOBOL equivalentCOBOL bytes
SMALLINT2PIC S9(4) COMP2
INTEGER4PIC S9(9) COMP4
DECIMAL(x,y)INT(x/2)PIC S9(x-y)V9(y)INT(((p+q)/2) +1)

Updated on: 14-Sep-2020

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements