Sorting columns

The SORT command sorts data on the current tabular panel, including its alternate form (displayed with the ? command).

The SORT command sorts columns in ascending or descending order. The SORT command applies only to the current panel, and each panel can contain uniquely sorted columns. Under ISPF, the sort criteria for each panel are saved.

You can use the SORT command-name command to sort the main panel by command.

The SORT parameters are shown in Table 1.
The parameter usage is as follows:
SORT (column) (A | D) column (A | D)
       (+ | -) column (A | D)            
       (OFF | ON)                       
       (?)

SORT with no parameters sorts a panel using the fixed (first) column.

Consider the following examples:
  • SORT - Sorts using the fixed output field, ascending.
  • SORT FO A TOT-REC D - Sorts using the FORMS column, ascending, and then the TOT-REC column, descending.
Column headers are point-and-shoot fields. To sort a column in ascending order using point-and-shoot fields, place the cursor on the column header and press Enter:
  • 1st time will sort ascending.
  • 2nd time will sort descending.
  • 3rd time will remove sort criteria and turn off sorting.
Table 1. SORT Parameters
Parameter Description
column The title of the column to be sorted. Specify the title as it appears on the panel, or abbreviate it to a name that is unique on the panel. If the title contains blanks, either use an abbreviation that contain no blanks or enclose the title in quotation marks.

The titles for the same column on the primary and alternate form of a panel may be different. SDSF recognizes the difference and sorts both the primary and alternate forms of the panel. SDSF does not distinguish between duplicate column names that vary only by case.

A | D Specifies that the sort order is to be ascending (A) or descending (D). A is the default, but you must specify either A or D when you enter two columns.
+column | -column Adds (+) or removes (-) sort criteria for a column. You can sort on up to 10 columns.
OFF Turns sorting off for the current panel but retains the sort criteria.
ON Turns sorting on.
? Under ISPF, displays the sort criteria pop-up. Under TSO, if the criteria do not fit on the command line, they are displayed on the message line.

Additional SORT commands

The additional SORT commands are shown in Table 2.
Table 2. Additional SORT Commands
Command Description
SORT OFF Turns sorting off for the current panel but retains the sort criteria.
SORT ? Under ISPF, use SORT ? to display the sort pop-up.