VMS Help
SORT, Specification File Qualifiers, /KEY, Examples

 *Conan The Librarian (sorry for the slow response - running on an old VAX)

    1./FIELD=(NAME=SALARY,POSITION:10,DIGITS:8,DECIMAL)
      /KEY=(SALARY,DESCENDING)

      This /KEY qualifier specifies that the key field is SALARY and
      that the sorting order is descending.

    2./FIELD=(NAME=ZIP,POSITION:20,SIZE:6)
      /CONDITION=(NAME=LOCATION,
                  TEST=(ZIP EQ "01863"))
      /KEY=(IF LOCATION THEN 1
            ELSE 2)

      In this example, all the records with the zip code 01863 are
      to appear at the beginning of the sorted output file. The
      conditional test LOCATION (defined in a /CONDITION qualifier)
      is on the ZIP field (named in a /FIELD clause). The values of
      1 and 2 in this /KEY clause signify a relative order for those
      records that satisfy the condition and those that do not.
  Close     HLB-list     TLB-list     Help  

[legal] [privacy] [GNU] [policy] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.