15.10 - Large Decimal Support - Preprocessor2 for Embedded SQL

Teradata Preprocessor2 for Embedded SQL Programmer Guide

prodname
Preprocessor2 for Embedded SQL
vrm_release
15.10
category
Programming Reference
featnum
B035-2446-035K

Beginning with PP2 9.2 and Teradata Database V2R6.2, there is support for an increase from 18 digit decimals to 31 digit decimals for mainframe systems and 38 digit decimals for network systems.

The default remains 18 digits, allowing full compatibility with existing programs. To change the default, specify the preprocessor option DECIMAL(nn) or -dec nn. Valid values for network systems are:

  • -dec(38)
  • -dec(18)
  • -dec(0)
  • If –dec(0)is specified, the option is ignored and the default of 18 digits remains.

    Valid values for mainframe systems are:

  • DECIMAL(31)
  • DECIMAL(18)
  • DECIMAL(0)
  • If DECIMAL(0)is specified, the option is ignored and the default of 18 digits remains.

    In this example, the employee number is specified as a larger binary integer, and the salary is specified as a larger decimal value:

    DCL 01 EMPLOYEE_RECORD,
    	 02 EMPNUM				BIN FIXED(64), 
    	 02 SALARY				DEC FIXED(29,2);