Using keyed sequence access paths for database files
A keyed sequence access path is based on the contents of the key fields as defined in data description specifications (DDS).
This type of access path is updated whenever records are added or deleted, or when records are updated and the contents of a key field is changed. The keyed sequence access path is valid for both physical and logical files. The sequence of the records in the file is defined in DDS when the file is created and is maintained automatically by the system.
Key fields defined as character fields are arranged based on the sequence defined for EBCDIC characters. Key fields defined as numeric fields are arranged based on their algebraic values, unless the UNSIGNED (unsigned value) or ABSVAL (absolute value) DDS keywords are specified for the field. Key fields defined as DBCS are allowed, but are arranged only as single bytes based on their bit representation.
- Arranging key fields in an alternative collating sequence
You can arrange key fields that are defined as character fields either in a sequence for EBCDIC characters or in an alternative collating sequence.
- Arranging key fields with the SRTSEQ parameter
You can arrange key fields that contain character data in a sort sequence order by using the SRTSEQ parameter.
- Arranging key fields in ascending or descending sequence
You can arrange key fields in either ascending or descending sequence. When you describe a key field, the default is ascending sequence. However, you can use the Descend (DESCEND) DDS keyword to specify that you want to arrange a key field in descending sequence.
- Using more than one key field
You can use more than one key field to arrange records in a database file. The key fields do not have to use the same sequence.
- Preventing duplicate key values
DB2 Universal Databaseā¢ for iSeriesā¢ allows records with duplicate key values in a database file. However, you can prevent duplicate key values in your files.
- Arranging duplicate keys
If you do not specify the Unique (UNIQUE) keyword in data description specifications (DDS), you can specify how the system stores records with duplicate key values.
Parent topic:
Describing access paths for database files