ENFORM Reference Manual
LIST Statements
Statements
4–36 058057 Tandem Computers Incorporated
returns one record for each job in each department. Only the first employee name
(empname) for each job is returned, as follows:
COUNT
DEPT JOB EMPNAME SALARY EMPNAME
---- --- ------- ------ -------
0101 MANAGER JACK RAYMOND 36000 2
SALESMAN JIM HERMAN 19000 2
SECRETARY KATHRYN DAY 12000 1
SYS.-ANAL LARRY CLARK 25000 1
0102 MANAGER TONY CRAFT 37000 1
SALESMAN GEORGE FORSTER 30000 1
0201 MANAGER DAVID STRAND 39000 2
PROGRAMMER SUSAN CHAPMAN 17000 1
When you implicitly request a summary report, you also get a report 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 a
summary report). For example:
SET @SUMMARY-ONLY TO OFF;
LIST BY dept, BY job, BY empname,
COUNT (empname OVER job);
returns one record for each job in each department. Again, only the first employee
name (empname) for each job is returned:
COUNT
DEPT JOB EMPNAME EMPNAME
---- --- ------- -------
0101 MANAGER JACK RAYMOND 2
SALESMAN JIM HERMAN 2
SECRETARY KATHRYN DAY 1
SYS.-ANAL LARRY CLARK 1
0102 MANAGER TONY CRAFT 1
SALESMAN GEORGE FORSTER 1
0201 MANAGER DAVID STRAND 2
PROGRAMMER SUSAN CHAPMAN 1
If you want a report that consists of only by-items and aggregates to contain all report
lines (including those where the last value of a by-item has not changed but a
subordinate by-item value has changed), then you must include a target-item in the
target-list that has not appeared as a by-item or aggregate. This target-item can be
modified by the NOPRINT clause if desired. Of course, you must also set
@SUMMARY-ONLY to OFF. For example:
SET @SUMMARY-ONLY TO OFF;
LIST BY dept, BY job, BY empname, salary NOPRINT,
COUNT (empname OVER job);