johnv@sequent.UUCP (John VanZandt) (09/01/90)
I want to sort a stack by multiple fields, with a major and several minor sort fields. How can this be done?
dlugose@uncecs.edu (Dan Dlugose) (09/03/90)
In article <41691@sequent.UUCP> johnv@eng2.UUCP (John VanZandt) writes: >I want to sort a stack by multiple fields, with a major and several minor >sort fields. How can this be done? The simplest sort method would be consecutive sort commands in the reverse order of importance. For example, if you had a stack of student grades in the range A..F, class 1..5 , and you wanted the main division to be grades, first all A's, within that sorted by class 1..5, within that sorted by last name, this would work: sort by field "last name" sort by field "class" sort by field "grade" -- Dan Dlugose Internet: dlugose@uncecs.edu UNC Educational Computing Service Box 12035, Research Triangle Park, NC 27709-2035
man@vali.cs.brown.edu (Mark H. Nodine) (09/05/90)
In article <1990Sep3.140709.16158@uncecs.edu>, dlugose@uncecs.edu (Dan Dlugose) writes: |>In article <41691@sequent.UUCP> johnv@eng2.UUCP (John VanZandt) writes: |>>I want to sort a stack by multiple fields, with a major and several minor |>>sort fields. How can this be done? |> |>The simplest sort method would be consecutive sort commands in the |>reverse order of importance. For example, if you had a stack of |>student grades in the range A..F, class 1..5 , and you wanted the |>main division to be grades, first all A's, within that sorted by |>class 1..5, within that sorted by last name, this would work: |> |>sort by field "last name" |>sort by field "class" |>sort by field "grade" It is also possible to do the sort in a single command: sort by field "last name" & numtochar(1) & field "class" & numtochar(1) & field "grade" where the numtochar(1) serves as delimiters. --Mark