Enform Plus Reference Manual

Statements
Enform Plus Reference Manual422684-001
4-21
Request-Qualification
An input element must be sufficiently qualified to avoid any ambiguity between it
and any other element specified in the query.
Request-Qualification
Use the WHERE clause to limit the records written to the physical output file or
transmitted to the host-language program. See the WHERE Clause on page 5-72.
Summary Records
A FIND statement can be specified that either creates a new file containing only
summary records or transmits only summary records to a host-language program. Such
summary records contain only the first target-record from each group (created by
a BY or BY DESC clause) down to some level. Summary records can be generated only
by a query that contains an aggregate.
The two methods of obtaining summary records are:
Explicitly request summary records by setting the @SUMMARY-ONLY option
variable to ON before issuing the only statement.
Implicitly request summary records by specifying only by-items and aggregates
over by-items in the query.
When you explicitly request summary records you get target-records summarized
down to the lowest level where an aggregate is calculated over that level. For example:
SET @SUMMARY-ONLY TO ON;
FIND findfil
( BY employee.dept,
BY employee.job,
BY employee.empname,
employee.salary,
COUNT(employee.empname OVER employee.job);
returns one target-record for each job in each department. Only the first employee
name (empname) for each job is returned.
When you implicitly request summary records, you get target-records
summarized down to the lowest level where an aggregate is computed over that level. (A
query requesting only by-items and aggregates over ALL is not an implicit request for
summary records). For example:
SET @SUMMARY-ONLY TO OFF;
FIND findfil
(BY employee.dept,
BY employee.job,
BY employee.empname,
numemp:= COUNT (employee.empname OVER employee.job));
returns one target-record for each job in each department. Only the first employee
name (empname) for each job is returned.