Edit command SORT Edit command SORT Author: David McRitchie formatted on 1995/04/01 06:54 for assistance contact: D. McRitchie DMcRitchie@hotmail.com -------------------------------------------------------------------------------- COMMAND NAME. SORT users. PDF EDIT users type. Edit Command -- part of ISPF -------------------------------------------------------------------------------- SORT Sort Data ISPF command -------------------------------------------------------------------------------- The SORT command is used to put data in a specified order. The data columns to be sorted are defined by the current boundaries. If you are using default bounds, there are no columns of data outside of the bounds, and so the entire record is sorted. If you have set bounds using the BOUNDS line or primary command, then only data between the bounds will be compared and arranged in sort order. Data outside of the bounds is not compared and it is not moved. This makes it possible to set bounds to columns 1-36 and sort the data in columns 1-36, then set the bounds to columns 37-72 and sort the data in columns 37-72. To display the HELP information available for ISPF SORT 1) Edit a member using PDF edit 2) ===> SORT ? 3) hit HELP key twice, or type in the word HELP and hit enter after each -------------------------------------------------------------------------------- Since square brackets are not available, optional material is enclosed in European brackets <...>. ISREDIT SORT > -------------------------------------------------------------------------------- X, indicates that only excluded lines are to be sorted NX, indicates that only non-excluded lines are to be sorte d sortfield-1, 2, ... indicates the fields that define the sort operation. You can specify up to five sort-fields as follows: where "A" indicates ascending order, and "D" indicates descending order. The "A" or "D" can either precede or follow the column specification. "A" is assumed if neither "A" nor "D" is specifie d. If "A" or "D" is specified for one field, it must be specified fo r all fields. Start-col and end-col define the field that is to be compared. Both must be within the current boundaries. If several fields are specified, both the starting and ending columns of each field must be specified. For further information about sort fields, refer to SC34-2139 ISPF/PDF PROGRAM REFERENCE label-range, indicates that two line pointers are required to indicate a range of lines for the sort operation. Pointers must be a labels. Specifying one line pointer is invalid. The following return codes may be issued: 0 - Normal completion 4 - Lines were already in sort order 20 - Severe error Examples: SORT Used to sort the entire file in ascending order. SORT D 15 20 Used to sort the file in descending order, using the sort key of columns 15 through 20. SORT X A Used to sort all excluded lines in ascending order. SORT .A .B Used to sort lines between labels .A and .B in ascending order. SORT .A .B 5 Used to sort lines between labels .A and .B, using the sort key in column 5. SORT .A .B 15 20 D 25 35 A Used to sort lines between labels .A and .B, using the sort key of 15 through 20 in descending order and the sort key 25 through 35 in ascending order. Notice: Since this COMMAND can make very major changes in the format of your PDS member being edited; and, because errors in BOUNDS or sort control can change data very significantly, it would be wise to save your data before invoking the SORT command. To further insure the integrity of your data you may also want to use AUTOSAVE OFF.