SORT command
The SORT primary command sorts the data set list by the specified field. Use this format:
where:
- field1
- The major sort field. If only one operand is used, ISPF treats it as field1. If both operands are used, ISPF sorts the list by field1 first, then by field2 within field1.
- field2
- The minor sort field.
- A|D
- The direction in which values are sorted for this field (A=ascending, D=descending).
For example, to sort a data set list by volume and block size within
each volume, use this command:
SORT VOLUME BLKSZ
If you do not specify a field, ISPF sorts the list by data set
name. The keywords described in Table 1 tell
ISPF by which fields to sort the data set list.
Field | Default Sequence | Description |
---|---|---|
NAME | Ascending | Data set name |
MESSAGE | Ascending | Command completion message |
VOLUME | Ascending | Volume serial |
DEVICE | Ascending | Device type |
DSORG | Ascending | Data set organization |
RECFM | Ascending | Record format |
LRECL | Descending | Logical record length |
BLKSZ | Descending | Block size |
TRACKS | Descending | Data set size |
%USED | Descending | Percentage used |
XT | Descending | Extents used |
CREATED | Descending | Creation date |
EXPIRES | Ascending | Expiration date |
REFERRED | Descending | Last accessed data |
MVOL | Ascending | Multivolume or migration level |
CATALOG | Ascending | Catalog Name |
Automatic scrolling is performed, if necessary, to bring the major sort field into view. ISPF displays a progress status pop-up panel when the necessary information to perform a SAVE or SORT primary command has to be retrieved and the data set list comprises 50 or more data sets. The keyboard locks when this pop-up panel appears and stays locked until the SAVE or SORT command is completed. This happens regardless of the setting of Display Total Tracks option and the value entered in the Initial View field.
Note: When Display Total Tracks is ON and Initial View = 2 (Space)
or 4 (Total), the pop-up panel appears during the data set list display
when it comprises 50 or more data sets and all the track information
is to be retrieved. When the SORT command is subsequently issued the
pop-up is not displayed as the data is already available.