BREAK.SUP

BREAK.SUP

Top  Previous  Next

 

The BREAK.SUP field qualifier keyword causes the query processor to generate a breakpoint whenever the field value changes. The field is not displayed in the report.

 

 

Format

 

BREAK.SUP  { "options" } field

 

where

 

optionscontrols the appearance of the breakpoint.

 

fieldis the field name or evaluated expression to be reported.

 

 

The BREAK.SUP keyword appears before the field name and causes the query processor to generate a breakpoint whenever the field value changes. Queries using breakpoints should also sort on the breakpoint field(s).

 

The action taken at the breakpoint depends on the optional options component and whether any field value accumulations (AVERAGE, CALC, MAX, MIN, PERCENTAGE or TOTAL) are in use.

 

A breakpoint with no options and no field accumulations prints a line with two asterisks in the column for the field causing the breakpoint followed by a blank line. If field accumulations are present, subtotals are also printed for each accumulated column. A line of hyphens may appear above the subtotals depending on the use of the U breakpoint control code.

 

The options item is as for BREAK.ON though the text will never appear and only some control options are of use with BREAK.SUP. The useful control codes are:

 

B{n}Start a new page, retaining the value of the breakpoint field for inclusion in the page heading/footing by use of the B heading text option. The optional single digit qualifier, n, allows collection of values from multiple breakpoints for inclusion in a composite heading. If omitted, the value of n defaults to zero. Thus use of B alone is equivalent to use of B0.
DOmit the subtotal line if there is only one line of detail for this breakpoint.
LEmit a blank line in place of the breakpoint. Any text in the options string will be ignored.
NResets page number to one at each breakpoint. This implies the P option if not used with B or P.
PStart a new page.
UIf the PICK.BREAKPOINT.U mode of the OPTIONcommand is in effect, this mode inserts a line of hyphens above any subtotals, etc. If this option is not in effect, the line of hyphens is produced unless the U mode is used.
XSave previous value of breakpoint field in @BPV.

Combinations of control codes may be used together.

 

 

Pick Syntax

 

If the PICK.BREAKPOINT mode of the OPTION command is in effect, the options element of the BREAK.SUP appears after the field rather than before.

 

 

Examples

 

The command

 

LIST SALES BY REGION BREAK.SUP REGION SALESMAN TOTAL ORDER.VALUE

 

might produce a display such as that below.

 

LIST SALES BY REGION BREAK.SUP REGION SALESMAN TOTAL ORDER.VALUE       Page 1

SALES..... SALESMAN  ORDER VALUE

19887       Roberts        279.40

19859       Sharp          384.43

19858       Sharp          845.50

19845       Harris         234.53

                     -----------

                         1743.86

 

19866       Abbott         465.31

19886       Abbott         397.23

19830       Smith          324.39

                     -----------

                         1186.93

 

                     ===========

                         2930.79

 

7 records listed.

 

 

For this same data, the command

 

LIST SALES BY REGION BREAK.SUP "'B'" REGION SALESMAN TOTAL ORDER.VALUE HEADING "SALES FOR REGION: 'B'"

 

would produce

 

SALES FOR REGION: North

SALES..... SALESMAN  ORDER VALUE

19887       Roberts        279.40

19859       Sharp          384.43

19858       Sharp          845.50

19845       Harris         234.53

                     -----------

                         1743.86

<<page>>

SALES FOR REGION: South

SALES..... SALESMAN  ORDER VALUE

19866       Abbott         465.31

19886       Abbott         397.23

19830       Smith          324.39

                     -----------

                         1186.93

 

                     ===========

                         2930.79

 

7 records listed.

 

 

Consider a report such as the following:

 

LIST SALES BY REGION BREAK.ON REGION SALESMAN TOTAL VALUE

Order No..   Region....   Salesman..   Value..

10928        Central      Hughes        777.00

            **                        -------

            Central                    777.00

 

10275        North        Roberts       268.00

10274        North        Jones         876.43

10268        North        Roberts      1033.77

            **                        -------

            North                     2178.20

 

10272        South        Edwards       768.33

10269        South        Edwards       564.98

10000        South        Abbott        111.00

10273        South        Smith         879.34

            **                        -------

            South                     2323.65

 

                                      =======

                                      5278.85

 

This report could be improved by omitting the region column and instead showing the region name on the subtotal line for the salesman column:

 

LIST SALES BY REGION BREAK.SUP "'X'" REGION CALC SALESMAN.REGION TOTAL VALUE

TEST......   Salesman..   Value..

10928        Hughes        777.00

            ----------   -------

            North         777.00

 

10275        Roberts       268.00

10274        Jones         876.43

10268        Roberts      1033.77

            ----------   -------

            North        2178.20

 

10272        Edwards       768.33

10269        Edwards       564.98

10000        Abbott        111.00

10273        Smith         879.34

            ----------   -------

            North        2323.65

 

            ==========   =======

            Total        5278.85

 

The X breakpoint control option saves the previous value of the breakpoint field, the region name in this example, in the @BPV variable. The SALESMAN.REGION dictionary item is an I-type expression:

if @nb = 0 then salesman else if @nb = 255 then 'Total' else @bpv

The effect of this expression, when used with the CALC keyword, is that the detail lines (for which @NB is zero) return the salesman name, the grand total line (@NB = 255) returns "Total" and the other breakpoint lines return the value of @BPV.

 

 

See also:

BREAK.ON