Subtotals and Cumulative Total with DET-SUPP
You can generate a report listing only the subtotals and accumulated total by adding the DET-SUPP modifier to the format specification clause.
In the following example, guests without a charge for a room (BILL-CODE # "2") but with charges for telephone calls (BILL-CODE "15") are selected. The total charges for these guests are calculated.
In the sample sentence, the two BILL-CODE literals are ANDed together to select only unregistered guests with phone charges.
The EACH modifier precedes the second BILL-CODE specification because the attributes are multivalued. If EACH is not specified, the selection clause is not executed as expected.
Because the sentence might have exceeded 240 characters, the continuation character (ctrl+_) was used to break the sentence in two parts.
:LIST GUESTS WITH BILL-CODE "15" AND WITH EACH BILL-CODE # "2" BREAK-ON LAST-NAME TOTAL BILL-TOTAL GRAND-TOTAL "AMOUNT DUE 'U'"_ :DET-SUPP HDR-SUPP GUESTS Last Name. Bill Total 143 Hennessey $46.35 144 Irving $47.95 - - - - AMOUNT DUE $94.30
If you do not specify "DET-SUPP", detail and blank lines are included in the report:
:LIST GUESTS WITH BILL-CODE "15" AND WITH EACH BILL-CODE # "2" BREAK-ON LAST-NAME TOTAL BILL-TOTAL GRAND-TOTAL "AMOUNT DUE 'U'" HDR-SUPP GUESTS Last Name. Bill Total 143 Hennessey $46.35 *** $46.35 144 Irving $47.95 *** $47.95 - - - - AMOUNT DUE $94.30