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

Table 13-33 shows the specification of the sign portion of signed packed format data in HiRDB.

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

Sign portionMeaning
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 Tables 13-34 and 13-35. 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-34 Rules for converting the sign portion of the signed packed format data (for non-0 data)

Sign portion of embedded variable dataWithout normalizationWith normalization
X'A'ErrorConverted to X'C'
X'B'ErrorConverted to X'D'
X'C'No conversionNo conversion
X'D'No conversionNo conversion
X'E'ErrorConverted to X'C'
X'F'No conversionConverted to X'C'
X'0' to X'9'ErrorError

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

Sign portion of 0 dataWithout normalizationWith normalization
X'A'ErrorConverted 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 may 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 may 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 may 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 may 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 may 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 manual HiRDB Version 8 UAP Development Guide.