Key string comparisons made by the copy operation
When the TOKEY value is specified, the check made by the copy operation is a logical character comparison between the key string for each record retrieved. The key strings can be specified explicitly using the first TOKEY parameter format or built implicitly by the copy operation that uses the list of values that are given.
A warning message is sent (but the copy operation continues) if this comparison gives different results than the ordering in which the database identifies the records in the keyed access path. The order might be different if:
- The key contains mixed ascending and descending fields
- The key contains fields for which a sort sequence other than *HEX is in effect OR
- The key contains any of the following DDS keywords:
- ABSVAL
- Absolute value
- ALTSEQ
- Alternative collating sequence
- ALWNULL
- Allow null
- DATFMT
- Date format (*MDY, *DMY, *YMD, *JUL, SAA® *EUR, or SAA *USA)
- DIGIT
- Digit force
- SIGNED
- Signed numeric
- TIMFMT
- Time format (*USA)
- ZONE
- Zone force
If there are both ascending and descending fields in the file key, the first (the far left) key field determines whether the copy operation uses an ascending or descending key test to look for the last record to copy.
Using *BLDKEY is the easiest way to specify (and ensure correct padding) values for packed, binary, and floating-point fields.
Parent topic:
Selecting records by record keys (FROMKEY and TOKEY parameters)