PM66095: HELP WITH HANDLING THE RELEASE INCOMPATIBLE CHANGE FOR VARCHAR( DECIMAL), CAST (DECIMAL AS CHAR), CAST(DECIMAL AS VARCHAR)
In Version 10, the formatting of decimal data has changed for the VARCHAR function and the CAST specification with decimal input and VARCHAR or CHAR output. There are two changes:
1. Leading zeroes are removed from the input decimal value.
2. The decimal point is not returned if the scale of the decimal value is zero.
- Remove leading zero
CAST(00.10 AS VARCHAR(4)) or
CAST(00.10 AS CHAR(4))
V10 result is '.10'
V9 result is '0.10'
- No trailing decimal point
CAST(1. AS VARCHAR(2)) or
CAST(1. AS CHAR(2))
V10 result is '1'
V9 result is '1.'
After application of this PTF, the default behavior for the VARCHAR function and CAST specification with decimal input will revert to the DB2 9 for z/OS result if the BIF_COMPATIBILITY system parameter is set to the new value V9_DECIMAL_VARCHAR. Please refer to the DB2 9 for z/OS SQL Reference for documentation of the formatting of decimal data. Following are examples of the differences in the output of VARCHAR and CAST between V9 and V10 :