The SORT primary command sorts the directory list by the specified
field. Use this format:
>>-SORT--+----------------------------------+------------------><
'-field1--+---+--+--------+--+---+-'
+-A-+ '-field2-' +-A-+
'-D-' '-D-'
where:
- field1
- The major sort field. If omitted, Filename is assumed.
- field2
- The minor sort field. If both operands are used, ISPF sorts the
list by field1 first, then by field2 within field1.
- A|D
- Specifies the sort sequence for the associated sort field (A=ascending;
D=descending). By default, character fields are sorted alphabetically
and numeric fields are sorted in descending order.
For example, to sort a directory list by file type and then in
descending order by modification date and time within each file type,
use this command:
SORT TYPE MODIFIED
This table identifies the sort field names and associated sort
sequence:
Table 1. Sort field names
and associated sort sequenceField |
Sequence |
Description |
---|
FILENAME|FILE|NAME |
Ascending |
File name |
MESSAGE|MES |
Ascending |
Command message |
TYPE |
Ascending |
File type |
PERM |
Ascending |
Permissions |
PERMO |
Descending |
Permissions (octal) |
AUDIT|AUD |
Ascending |
Audit bit settings |
EXTA|EXT |
Ascending |
Extended attributes |
FORMAT|FMAT |
Ascending |
File format |
OWNER|OWN |
Ascending |
File owner |
GROUP|GRP |
Ascending |
Owner group |
LINKS |
Descending |
File links |
SIZE |
Descending |
File size |
MODIFIED|MOD |
Descending |
Date/time file last changed |
CHANGED|CHG |
Descending |
Date/time file status last changed |
ACCESSED|ACC |
Descending |
Date/time file status last accessed |
CREATED|CRE |
Descending |
Date/time file was created |