Previous Topic: Set Linkage for Chain SetsNext Topic: Index Sets


Set Order

The logical order in which new members are linked into a set occurrence follows one of the following user-specified methods:

Note: An element that is part of a sort key is also referred to as a sort control item.

The following diagram illustrates the effects of NEXT and PRIOR set order in a chain set. We are positioned on Sandy Shore and add June Moon. If the set order is NEXT, June Moon follows Sandy Shore. In a PRIOR-ordered set, June Moon precedes Sandy Shore.

The following diagram illustrates the effects of FIRST and LAST set order in a chain set. In each case, we add four records to the database: Peter Plum, Sandy Shore, John Done, and June Moon. If the set order is LAST, each new record is added at the end of all current members. The result is a First-In-First-Out (FIFO) ordering of the members, since the first member in the set is the first member added. If the set order is FIRST, each new record is added ahead of all current members, resulting in a Last-In-First-Out (LIFO) ordering of the members.

The following diagram illustrates the effects of SORTED set order and various duplicates options in a chain set. The sort key is the employee's last name. The first set occurrence represents a set whose members are sorted ascending by last name, while the second represents a set sorted descending by last name. The remaining three show the impact of different duplicates options when a second occurrence of June Moon is added to a set whose sort order is ascending.