Key fields can be arranged in either ascending or descending sequence.
Consider the following records.
Record |
Empnbr |
Clsnbr |
Clsnam |
Cpdate |
1 |
56218 |
412 |
Welding I |
032188 |
2 |
41322 |
412 |
Welding I |
011388 |
3 |
64002 |
412 |
Welding I |
011388 |
4 |
23318 |
412 |
Welding I |
032188 |
5 |
41321 |
412 |
Welding I |
051888 |
6 |
62213 |
412 |
Welding I |
032188 |
|
If the
Empnbr field is the key field, the two possibilities for
organizing these records are:
- In ascending sequence, where the order of the records in the access path
is.
Record |
Empnbr |
Clsnbr |
Clsnam |
Cpdate |
4 |
23318 |
412 |
Welding I |
032188 |
5 |
41321 |
412 |
Welding I |
051888 |
2 |
41322 |
412 |
Welding I |
011388 |
1 |
56218 |
412 |
Welding I |
032188 |
6 |
62213 |
412 |
Welding I |
032188 |
3 |
64002 |
412 |
Welding I |
011388 |
|
- In descending sequence, where the order of the records in the access path
is.
Record |
Empnbr |
Clsnbr |
Clsnam |
Cpdate |
3 |
64002 |
412 |
Welding I |
011388 |
6 |
62213 |
412 |
Welding I |
032188 |
1 |
56218 |
412 |
Welding I |
032188 |
2 |
41322 |
412 |
Welding I |
011388 |
5 |
41321 |
412 |
Welding I |
051888 |
4 |
23318 |
412 |
Welding I |
032188 |
|
When you describe a key field, the default
is ascending sequence. However, you can use the DESCEND DDS keyword
to specify that you want to arrange a key field in descending sequence.