Enform Plus Reference Manual
Statements
Enform Plus Reference Manual—422684-001
4-32
Group Definition and Sorting
entry-sequenced, unstructured) of the data file. The actual file type of a data file must be 
the same as the file type described in the record description; otherwise, your query might 
return incorrect results.
Group Definition and Sorting
BY and BY DESC clauses group and sort records. Enform Plus prints the by-item value 
for a group only for the first record of all the records that have the same value for the 
by-item. A by-item can be referred to by CUM OVER, PCT OVER, SUBTOTAL 
OVER, AFTER CHANGE, and BEFORE CHANGE clauses. These clauses are described in 
Section 5, Clauses
.
ASCD and DESC clauses sort records in ascending or descending order. They do not 
identify a group. The ASCD and DESC clauses are described in Section 5, Clauses
.
When a LIST statement contains more than one BY, BY DESC, ASCD, or DESC clause, 
Enform Plus determines a major to minor sorting precedence. Enform Plus determines 
the sorting precedence by the order in which the clauses appear in the LIST statement. 
The first clause has highest priority and is sorted first, the next one second priority, down 
to the last specified clause.
How Values Are Displayed in Report Columns
Enform Plus displays target-items and by-items in report columns, one column 
per item. If a record name is a target-item in a LIST statement, Enform Plus 
expands the record to as many target-items as the number of elementary fields in 
the record. If a field within the record is described with an OCCURS clause, Enform Plus 
prints each occurrence of the field in a separate column of the report. Do not specify a 
record name as a target-item if it is the same as a field name in a record. See 
Section 3, Enform Plus Language Elements
 for information about field names. A 
target-item in a LIST statement can be any of the following:
•
A record name
LIST ...,
 parts;
•
The name of a field
LIST ...,
 partnum;
•
A numeric literal. Enclose numeric literals within parentheses.
LIST ...,
 (2001);
•
A string literal. Enclose string literals within quotation marks.
LIST ...,
 "manager";










