Scalable Database Server, HiRDB Version 8 Description

[Contents][Glossary][Index][Back][Next]

7.7 Facility for conversion to a decimal signed normalized number

The decimal, date interval, and time interval data formats are signed packed formats consisting of a value's integer and sign parts. Normally, HiRDB handles X'C' (positive), X'D' (negative), and X'F' (positive) as the sign parts of signed packed-format data as valid values, and stores directly in the database any signs that are input from a UAP or utility.* In addition, HiRDB treats +0 (sign part X'C' or X'F') and -0 (sign part X'D') as distinct values.

Use of the facility for conversion to a decimal signed normalized number enables conversion of the sign part of a signed packed decimal, date interval, or time interval data format.

* Type conversions and operations during the execution of SQL statements sometimes result in conversion of signs. In addition, the use of multicolumn indexes can result in conversion of signs.

Organization of this section
(1) Specification of the sign part of signed packed format
(2) Rules on conversion of the sign part of signed packed format
(3) Application criteria
(4) Environment setup

(1) Specification of the sign part of signed packed format

In HiRDB, specification of the sign part of signed packed format is as listed in Table 7-7.

Table 7-7 Specification of the sign part of signed packed format

Sign part Meaning
X'C' Indicates a positive value.
X'D' Indicates a negative value.
X'F' Indicates a positive value.

(2) Rules on conversion of the sign part of signed packed format

When the facility for conversion to a decimal signed normalized number is used, HiRDB converts during data input the sign part of signed packed format according to the rules in Tables 7-8 and 7-9. The process of converting a sign part is called normalization. When the sign part is converted, the codes +0 and -0 can be treated as being the same value.

Table 7-8 Rules for conversion of the sign part of signed packed format (other than "0" data)

Sign part of embedded variable Not normalized Normalized
X'A' Error Converts to X'C'.
X'B' Error Converts to X'D'.
X'C' No conversion No conversion
X'D' No conversion No conversion
X'E' Error Converts to X'C'.
X'F' No conversion Converts to X'C'.
X'0' - X'9' Error Error

Table 7-9 Rules for conversion of the sign part of signed packed format ("0" data)

Sign part of "0" data Not normalized Normalized
X'A' Error Converts to X'C'.
X'B' Error
X'C' No conversion
X'D' No conversion
X'E' Error
X'F' No conversion

(3) Application criteria

When UAPs with different sign part specifications are used, it may be beneficial to use the facility for conversion to a decimal signed normalized number. In such a case, this facility should be used after the sign conversion rules are adequately confirmed.

For example, if a UAP is transferred from XDM/RD E2 to HiRDB, it may be beneficial in some situations to use the facility for conversion to a decimal signed normalized number, because XDM/RD E2 and HiRDB have different specifications for the sign part of the decimal type.

(4) Environment setup

To use the facility for conversion to a decimal signed normalized number, you must specify pd_dec_sign_normalize=Y in the system common definition.

The facility for conversion to a decimal signed normalized number should be specified as soon as HiRDB is installed. If sign parts are to be normalized once operation of HiRDB is underway, it may be necessary to reload all table data in which the decimal type is defined.

For details about using the facility for conversion to a decimal signed normalized number, see the HiRDB Version 8 System Operation Guide.