Sort - Control Data Corporation 3300 Reference Manual

Computer systems usasi cobol/ master
Table of Contents

Advertisement

4.7.24
SORT
4-64
The SORT statement creates a sort file by executing input procedures or by
transferring records from another file. Records in the sort file are sorted on
a set of specified keys.
In
the final phase of the sort operation, each record
from the sort file is made available, in sorted order, to some output pro-
cedures or to an output file.
.
1
DESCENDING
l
5
l
SORT flle-name-I ON ASCENDING
, KEY
1
identifier-I,
[; ON
1 ~~~~!:'~G!
KEY
1
identifier-2! ... ] ...
{
INPUT PROCEDURE IS section-name-I [THRU section-name-2] }
USING file-name-2
{
OUTPUT PROCEDURE IS section-name-3 [THRU section-name-4] }
GIVING file-name-3
A program may contain more than one SORT statement in the Procedure
Division. No SORT statement may !lppear in the Declaratives Section or in
the input and output procedures associated with a SORT statement.
File-name-l is a sort file described in an SD entry in the Data Division.
Each identifier must represent data items described in records associated
with file-name-I. Section-name-I is the name of an input procedure; section-
name-3 names an output procedure. File-name-2 and file-name-3 are
described in FD entries in the Data Division. They are not sort files, and
must not be described in an SD entry. The FILE-CONTROL paragraph of
the Environment Division must specify only the SELECT and ASSIGN clauses
for a sort file (file-name-I). FILE-CONTROL for file-name-2 and file-
name-3 may include MULTIPLE and RESERVE as well as SELECT and
ASSIGN.
ASCENDING specifies a sorting sequence from the lowest to the highest value
of KEY; DESCENDING specifies a highest to lowest sequence. The order of
values is in accordance with the ordered character set given in appendix D.
The record description of every record listed in the DATA RECORDS clause
of the sort file must contain the KEY item s identifier-I, identifier-2, etc.
When KEY items appear in more than one record, data descriptions must be
equivalent and starting positions must be the same character positions relative
to the beginning of each record. They may not contain or be subordinate
to
entries that contain an OCCURS clause. The KEY identifiers are listed from
left to right in the SORT statement in order of decreasing significance without
regard to how they are divided into KEY clauses.
60229400

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 3300 and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

3500

Table of Contents