Most report requests can be generated using a single verb, but it's possible to use up to 16 verbs and their associated sort conditions. Multiple verbs (also known as display commands) can be used to summarize several levels of data, or to display summary data and detail data in one report. The rules for using multiple verbs are:
Aggregate verbs (SUM or COUNT) must be used before detail verbs (PRINT or LIST).
If more than 2 verbs are used, only the last verb may be a detail verb.
The first verb phrase does not require a sort condition.
When a sort phrase is used with a verb phrase, any subsequent verb phrases must use the same sorting condition in the same order.
WHERE and IF conditions apply to the records selected for the report as a whole.
The sample report below uses 3 instances of the verb SUM to calculate multiple levels of salary detail. The first verb phrase SUM AC:SALARY does not require a sort condition and calculates the total amount of salaries; the second verb phrase SUM AC:SALARY BY AC:UNIT calculates the total amounts of current salaries in each reporting unit; the second verb phrase SUM AC:SALARY BY AC:UNIT BY AC:WNAME calculates the total amounts of current salaries for each employee in each reporting unit. Note that for the last verb phrase, the sort phrase BY AC:UNIT must be repeated before the sort phrase BY AC:WNAME is used.
TABLE FILE AC
SUM AC:SALARY BY AC:UNIT
SUM AC:SALARY BY AC:UNIT BY AC:WNAME
ac:salary UNT ac:salary ac:wname ac:salary
--------- --- --------- -------- ---------
$29,522.00 100 $19,756.00 Camel, SUE $14,417.00
dog, jan $5,339.00
200 $9,766.00 Bear, bob $4,570.00
HIPPO, JIM $5,196.00
The sample report below uses 2 verbs to provide summary and detail information on employee positions. The first verb phrase COUNT AC:POSIT16 has an associated sort phrase BY AC:UNIT and provides the total number of positions by individual reporting units. The second verb phrase, PRINT AC:SSA AC:WNAME AC:POSIT16 provides detailed information on the employees and their position number and must repeat the sort phrase BY AC: UNIT used for the first verb phrase. Note that PRINT must be used as the last verb phrase because it is a detail verb.
PRINT ac:SSA AC:WNAME AC:posit16
UNT count ac:wname ac:posit16
--- ----------- --------- ----------
100 3 camel, sue 999-100-0820-000
camel, sue 999-100-1619-000
dog, jan 999-100-3300-000
200 2 bear, bob 999-200-2358-000
hippo, jim 999-200-0400-000
Related topic: Sample Request: Count and List of Employees
Last Updated: August 3, 2005