SORT-ITEM Command

The SORT-ITEM command displays all data elements for a list of sorted items. This command is useful for producing a listing of data or dictionary items, sorted by the data elements in a specified attribute. It is also useful for displaying programs and Procs.

Format

SORT-ITEM [DICT] filename [item-list] [selection] [sort-keys] [modifiers] [(options)]

Parameter(s)

DICT

Specifies the file dictionary.

filename

Name of the file.

item-list

List of individual item-IDs. Enclose each item-ID in single quotes.

selection

Specifies one or more conditions that an item must meet to be included in the report. For a complete description of selection expression syntax, see the LIST Command.

sort-keys

Specify which attributes to sort and whether to sort them in ascending or descending order. You can use the following modifiers with sort-keys:

BY

Sorts items in ascending order by the specified attribute.

BY-DSND

Sorts items in descending order by the specified attribute.

BY-EXP

Sorts a MultiValued attribute in ascending order and produces a separate line for each value.

BY-EXP-DSND

Sorts a MultiValued attribute in descending order and produces a separate line for each value.

If more than one sort-key is specified in a SORT command line, the system sorts these attributes from left to right (the leftmost sort-key is the most significant).

modifiers

Include one or more keywords that specify the report format. These parameters affect headers, footers, spacing, and more. For complete information about using these keywords, see the section, Connectives, Modifiers, and Options in the INFO/ACCESS User Reference Guide.

options

Include one or more single-character codes that specify the report format and direct or modify output. They must be enclosed in parentheses, can be entered in any order, and need not be separated by spaces or any delimiters such as commas. For complete information about using these parenthetical options, see the section, Connectives, Modifiers, and Options in the INFO/ACCESS User Reference Guide.

By default, the SORT-ITEM command sorts and displays items on the screen. The display includes line numbers for each attribute.

Listing Sorted Items

The following example displays all items in the ORDERS file, sorted by the amount of sale:

>SORT-ITEM ORDERS BY AMOUNT

 

PAGE   1               14:25:04  dd mmm yyyy

 

   10101

001 N01

002 2

003 AJOHN760JE

004 7380

005 4000

 

   10116

001 QR02

002 2

003 LLEE356FR

004 7942

005 4222

006 AX]55555998\588\]

 

   10119

001 N02

002 2

003 WGALL459BR

004 7114