CATOWNERCDRM


1 CATOWNERCDRM=
2.1 ROUND_CEILING
2.1 ROUND_DOWN
2.1 ROUND_FLOOR
2.1 ROUND_HALF_DOWN
2.1 ROUND_HALF_EVEN
2.1 ROUND_HALF_UP
2.1 ROUND_UP
CATOWNERCDRM
Specifies the current DECFLOAT rounding mode (CDRM) to be used when accessing a Db2® version 9 (or later) system.

This option is only relevant when FM/Db2 is connected to a Db2® version 9 or later system.

The CDRM refers to the behaviour of Db2® when processing a DECFLOAT number, where rounding of the value is required. See the Db2® manuals for a more detailed explanation.

If you intend to specify a CATOWNER parameter to implement access to the Db2® catalog tables (that is, FM/Db2 will access views of the Db2® catalog tables, rather than the catalog tables directly), you need to take account of the CDRM constraint as noted above. It is recommended that:
  • You create all of the views of the Db2® catalog table at the same time, and set the required CDRM before creating the views.
    The CDRM can be set using:
    SET CURRENT DECFLOAT ROUNDING MODE = value
    See the Db2® SQL Reference manual for a detailed explanation.
  • The value used for the CDRM should be specified in the CATOWNERCDRM parameter.
  • In the situation where FM/Db2 will access multiple Db2® version 9 (or later) systems, use the same CDRM value when creating the catalog table views for all target Db2® systems. Specify the selected value in the CATOWNERCDRM parameter.

If the CATOWNERCDRM parameter is omitted, or is incorrectly specified, FM/Db2 will auto-detect the CDRM mode used when attempting to access a view of the Db2® catalog table. This is an expensive procedure, requiring FM/Db2 to prepare up to 7 SQL statements each time a user accesses the Db2® system. It is therefore advisable for performance reasons to ensure that the CATOWNERCDRM value is correctly specified.

FM/Db2 will not function correctly if the required views of the Db2® catalog tables are created using more than one CDRM value.

ROUND_CEILING
Round towards positive infinity. If all of the discarded digits are zero or if the sign is negative, the result is unchanged other than the removal of discarded digits. Otherwise, the result coefficient is incremented by 1 (round up).
ROUND_DOWN
Round towards 0 (truncation). The discarded digits are ignored.
ROUND_FLOOR
Round towards negative infinity. If all of the discarded digits are zero or if the sign is positive, the result is unchanged other than the removal of discarded digits. Otherwise, the sign is negative and the result coefficient is incremented by 1 (round down).
ROUND_HALF_DOWN
Round to nearest value; if values are equidistant, rounds down. If the discarded digits represent greater than half (0.5) of the value of a number in the next left position, the result coefficient is incremented by 1 (round up). Otherwise, the discarded digits are ignored. This rounding mode is not recommended when creating a portable application because it is not supported by the IEEE draft standard for floating-point arithmetic.
ROUND_HALF_EVEN
Round to nearest value; if values are equidistant, round so that the final digit is even. If the discarded digits represent greater than half (0.5) of the value of a number in the next left position, the result coefficient is incremented by 1 (round up). If the discarded digits represent less than half of the value, the result coefficient is not adjusted (that is, the discarded digits are ignored). Otherwise, the result coefficient is unaltered if its rightmost digit is even, or is incremented by 1 (round up) if its rightmost digit is odd (to make an even digit).
ROUND_HALF_UP
Round to nearest value; if values are equidistant, round up. If the discarded digits represent greater than or equal to half (0.5) of the value of a number in the next left position, the result coefficient is incremented by 1 (round up). Otherwise the discarded digits are ignored.
ROUND_UP
Round away from 0. If all of the discarded digits are zero, the result is unchanged other than the removal of discarded digits. Otherwise, the result coefficient is incremented by 1 (round up).