cobol1.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
SORT file (↑ Statements)
 Key                                       Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
  Verb:         SORT
 
  Function:     Sorts records into order on a set of specified keys.
                These records can come from a file or from a table, or
                be created by an input procedure.
 
  Syntax:       Which format?   File   Table
 
                       ┌────────────────────────────────────┐
                       │                         ┌──────────┐
                       ▼                         ▼          │
  ──SORT file-name-1─┬──┬─┬─ASCENDING──┬─┬───┬─data-name-1─────
                       └ON┘ └─DESCENDING─┘ └KEY┘
 
  ─┬───────────────────────────────┬────────────────────────────
    └─┬────┬─DUPLICATES─┬──┬┬─────┬─┘
      └WITH┘            └IN┘└ORDER┘
 
  ─┬───────────────────────────────────────────┬────────────────
    └─┬─────────┬─SEQUENCE─┬──┬─alphabet-name-1─┘
      └COLLATING┘          └IS┘
 
           ┌──────────┐
           ▼          │
  ┬─USING file-name-2────────────────────────────────────────────────────┬
   └─INPUT PROCEDURE─┬──┬─procedure-name-1─┬─────────────────────────────┬┘
                     └IS┘                  └┬─THROUGH─┬─procedure-name-2─┘
                                            └─THRU────┘
 
            ┌──────────┐
            ▼          │
  ┬─GIVING file-name-3─────────────────────────────────────────────────┬─
   └─OUTPUT PROCEDURE┬──┬procedure-name-3─┬────────────────────────────┬┘
                     └IS┘                 └┬─THROUGH─┬─procedure-name-4┘
                                           └─THRU────┘
                                    -♦-