Nonstop Database, HiRDB Version 9 System Operation Guide

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

13.23.1 Overview of the facility for conversion to a decimal signed normalized number

Organization of this subsection
(1) Specification of the sign portion of the signed packed format
(2) Rules for converting the sign portion of signed packed format data
(3) Application criteria
(4) Environment setting
(5) Notes

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

The following table shows the specification of the sign portion of signed packed format data in HiRDB.

Table 13-45 Specification of the sign portion of the signed packed format data

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

(2) Rules for converting the sign portion of signed packed format data

When the facility for conversion to a decimal signed normalized number is used, the sign portion of signed packed format data is converted at the time of data input according to the rules described in Table 13-46 Rules for converting the sign portion of the signed packed format data (for non-0 data) and Table 13-47 Rules for converting the sign portion of the signed packed format data (for 0 data). This conversion of the sign portion is called normalization of the sign portion. Once the sign portion is normalized, +0 and -0 can be handled as the same value.

Table 13-46 Rules for converting the sign portion of the signed packed format data (for non-0 data)

Sign portion of embedded variable data Without normalization With normalization
X'A' Error Converted to X'C'
X'B' Error Converted to X'D'
X'C' No conversion No conversion
X'D' No conversion No conversion
X'E' Error Converted to X'C'
X'F' No conversion Converted to X'C'
X'0' to X'9' Error Error

Table 13-47 Rules for converting the sign portion of the signed packed format data (for 0 data)

Sign portion of 0 data Without normalization With normalization
X'A' Error Converted to X'C'
X'B' Error
X'C' No conversion
X'D' No conversion
X'E' Error
X'F' No conversion

(3) Application criteria

To use in HiRDB a UAP that specifies the sign portion in a different way, it might be desirable to use the facility for conversion to a decimal signed normalized number. This facility should be used only after checking carefully the sign conversion rules.

For example, when an XDM/RD or XDM/RD E2 UAP is moved to HiRDB, it might be appropriate to use the facility for conversion to a decimal signed normalized number, because XDM/RD and HiRDB specify the decimal signed portion differently.

(4) Environment setting

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

If possible, this operand should be specified when HiRDB is first installed. To normalize the signed portion while HiRDB is already being used, it is necessary to reload the data of tables for which the decimal type is defined.

(5) Notes

  1. When an SQL statement is executed while there is both normalized data and data that has not been normalized, corruption of the database or of the execution results might result. Thus, if you change the specification value of the pd_dec_sign_normalize operand, data must be reloaded and the normalization status must be standardized by executing the database reorganization utility (pdrorg command) and database load utility (pdload command); for details, see 13.23.2 Normalizing existing data.
  2. The following points must be noted when the facility for conversion to a decimal signed normalized number is used:
    • When you determine a storage destination RDAREA while using a UAP that uses a hash function for table partitioning on a hash partitioned table, specify use of the facility for conversion to a decimal signed normalized number in the arguments of the hash function for table partitioning. Otherwise, the results of the hash function for table partitioning might be invalid.
    • When a UAP is used to apply key range partitioning to a table with key range partitioning (the partitioning key is decimal data), you should use the facility for conversion to a decimal signed normalized number to convert the partitioning key values. If the partitioning key values are not converted, the key range partitioning results might be invalid.
    For details on the hash function for table partitioning and of the facility for conversion to a decimal signed normalized number, see the HiRDB Version 9 UAP Development Guide.