SORT

Purpose

Sorts the data.

Syntax

SORT { +| −}  vname {{ +| −} vname... }

Arguments and Subcommands

+ vname

Sort on vname in ascending order. (The + may be omitted.)

- vname

Sort on vname in descending order. (The  must be included.)

Remarks

This command sorts all data regardless of any selections in effect. The records in the data set are not actually rearranged by the sort. Instead a vector of pointers stored in the special variable %ORD is modified to indicate the order in which the data should be processed.

Example

To sort on the variable setno in ascending order and the variable cc in descending order:

SORT setno - cc @

Note that cc is 1 for cases and 0 for controls and setno is the identification number for matched sets, thus, this sort would group matched sets in order with cases listed first.