The format of a field that is part of a key is significant to IDMS when that field is specifically named as part of the key. If a numeric field is part of a group level element and the group name is specified as the key, IDMS is not aware of the elementary elements at run time and the entire group is treated as character format. No numeric format specific comparisons are attempted by IDMS against elementary elements that are a part of a group when the group name is specified as the key field.
When signed zoned decimal or signed packed decimal fields are identified as part of a set or index key, IDMS honors the format. At run-time the DBMS will normalize the sign nibbles so that comparisons against functionally equivalent values return a result of equal. This ensures that sorted chain sets and index sets will maintain their sequence based on a field's functional value.
Since unsigned zone decimal or packed decimal numbers are treated as character data, functionally equivalent values with different sign nibbles return a result of not equal during comparison operations. This can result in a different sequence for a sorted set or index set depending on the sign characteristic of the numeric field as depicted in the following example. Each set is assumed to have an ascending order and allows duplicates.
Signed: Unsigned:
02 FIELD-A PIC S9(5) COMP-3. 02 FIELD-A PIC 9(5) COMP-3.
02 FIELD-B PIC x(4). 02 FIELD-B PIC X(4).
x'00999C', c'AAAA' x'00999C', c'AAAA'
x'00999F', c'AAAA' x'00999C', c'BBBB'
x'00999C', c'BBBB' x'00999F', c'AAAA'
In the signed example, x'00999C' and x'00999F' are functionally equal and the relative position of the first two records is determined by the duplicates option and the sequence in which the records were added to the set. For the unsigned example the functional equivalence of the packed fields will not be recognized and x'00999F' is considered to be greater than x'00999C'. The duplicates option would not come into consideration since none of the three keys is considered to be equal.
|
Copyright © 2014 CA.
All rights reserved.
|
|