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.
Example 1
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.
Report Request:
|
Report Generated:
|
EX AC
TABLE FILE AC
SUM AC:SALARY
SUM AC:SALARY BY AC:UNIT
SUM AC:SALARY BY AC:UNIT BY AC:WNAME
END
|
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
|
Example 2
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.
Report Request:
|
Report Generated:
|
EX AC
TABLE FILE AC
COUNT AC:POSIT16
BY AC:UNIT
PRINT ac:SSA AC:WNAME AC:posit16
BY AC:UNIT
END
|
ac:position
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