ISPF COMMANDS – SORT, LOCATE, RESET, FLIP, COMPARE
SORT sorts data, observing bounds. The entire record is subject to sorting unless bounds are set. If bounds are on, only the data within the bounds is sorted and moved; other data is not moved. This is a way to sort columned data separately.
Sort lets you sort fields in either ascending or descending order. The maximum number of sort fields is five. When using multiple fields, both start and end columns must be provided. Default is ascending sort. If one field specifies ascending or descending, all fields must specify it. Here are a few examples:
SORT 10 sorts from column 10 to the right bound;
SORT 1 8 sorts based on the data within columns 1 through 8 inclusive;
SORT 1 15 X sorts all excluded lines based on the data in columns 1 through 15;
SORT 1 15 A 20 20 D sorts all lines based on two fields, the first field in ascending order and
the second in descending order. Note the second field is a single byte.
LOCATE finds a line label. The label can be the “line number”, any special label (e. g. =NOTE=, ==ERR>), your own label, or a pending line command. Here are a few examples:
- LOCATE ERR FIRST locates the first error line;
- LOC CHG NEXT locates the next changed line;
- L .HERE locates the label “.HERE”
- L 450 locates line label 000450;
- L SPECIAL locates the next special line (e. g. COLS, MASK, etc.);
- L LABEL PREV locates the previous label.
RESET clears all line commands, reshows excluded lines, deletes special lines, clears all line flags, and turns off the last FIND highlight. RESET with no operands cleans up everything except line labels. Operands can be provided to specify exactly what to reset:
label remove line labels
command (CMD) remove pending line commands
error remove ERROR notes
change (CHG) remove CHANGED notes
excluded (X) redisplays excluded lines
special Deletes all special lines (=PROF>, =BNDS>, =TABS>,
==MSG>, =NOTE=, =MASK>, =COLS>, and ======)
find reset FIND highlighting
FLIP swaps excluded and included lines.
COMPARE calls SuperC to compare the current edit session with another file. Lines existing only in the current file are marked with labels. Lines existing only in the other file are shown as information lines. You can add those lines to the current file using the MAKEDATA command (see Edit Line Commands, MD).
COMPARE with no arguments presents the Edit Compare Settings panel. Otherwise a DSN or member name is required for the file to be compared to. In place of the DSN you can use SESSION or an asterisk to compare the current edit session with the same dataset stored on disk. Other keywords are:
- EXCLUDE or X excludes matching lines, leaving only differences visible;
- SAVE saves the output to a dataset called ISPFEDIT.COMPARE.LIST;
- SYSIN does not free the SYSIN DD before invoking SuperC. That lets you pass more parameters to SuperC.