SORT-LIST

Sorts a list previously saved in POINTER-FILE.

Syntax

SORT-LIST {list-name {account-name}} {(options}

Syntax Elements

list-name The name of the saved list.

account-name The name of the account from which the list was saved.

If you do not specify account-name, the current account is used.

Options

n See option M.

C Counts number of identical attribute values, appending to the value the count, if greater than one, preceded by a subvalue mark. Only active with option U.

D Sort the list in descending order. If omitted, the list is sorted in ascending order.

E Specifies that complete attributes are to be processed.

If not specified, only the first field (value or subvalue) is processed, all the other fields being discarded. The sorted list therefore contains only the first field from each attribute.

If the E option is specified, the complete attributes are processed and included in the sorted list.

I Specifies that case should be ignored when comparing item-ids.

M Discards unique entries in list. If n is not specified, keeps one copy of each entry that appears more than once. If n is specified, keeps one copy of each entry that appears n or more times. If the list was created by merging two or more lists, this option gives the intersection.

N Inverts the M option so as to keep values that occur only once in a list. Relevant only with the M option. If the list was created by merging two or more lists, this option gives the symmetric difference.

R Sorts the list into right-aligned (numeric) order. The default, if not specified, is ASCII order.

S Specifies that case is significant when comparing item-ids.

U Removes multiple cases of a value. If the list was created by merging two or more lists, this option gives the union of lists.

Comments

Use SORT-LIST to sort a list modified by EDIT-LIST, or to avoid using SSELECT on a large file.

Unless the E option is specified, the sorted list will contain only the first field from each attribute.

Case Sensitivity

If neither I nor S is specified, the current data case setting (set with the DATA.CC environment option or the CASE TCL command) is used. See Case Sensitivity for more details.

If both I and S are specified an error message is displayed and the list is not sorted.

Example

:SELECT MD
429 ITEMS SELECTED.
>SAVE-LIST ALLMD
[241] 'ALLMD' Cataloged.
:SORT-LIST ALLMD

The list in ALLMD is now in ascending sequence.

Go to top button