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

DB2DatabaseBig Data Analytics

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)
raja
Published on 14-Sep-2020 14:35:14
Advertisements