IBM ISERIES SC41-5210-04 User Manual

Page 153

Advertising
background image

v If no break fields are selected, no summary functions are selected and final summaries are suppressed.

Only a count of the records is produced.

In a name and address file, for example, you might specify that two fields named

CITY and STATE be

specified as break fields. If

STATE was defined as the break field for break level 1, CITY was defined as the

break field for break level 2, and both fields were specified as break values in break text for their
respective levels, then the following sample report breaks and break text might appear in a report for the
following records:

Records in file:

| Lines in report:

|

LNAME

CITY

STATE | STATE CITY

LNAME

Brown

Rochester

MN

|

MN

Rochester

Brown

Jones

Rochester

MN

|

Jones

Smith

Rochester

MN

|

Smith

.

.

.

|

.

.

.

| Users in Rochester MN

.

.

.

|

Count

3

.

.

.

|

Adams

St Paul

MN

|

St Paul

Adams

.

.

.

|

.

.

.

| Users in St Paul MN

.

.

.

|

Count

1

.

.

.

| All Users in MN

.

.

.

|

Count

4

.

.

.

|

.

.

.

|

Calva

Rochester

NY

|

NY

Rochester

Calva

Doe

Rochester

NY

|

Doe

Smith

Rochester

NY

|

Smith

.

.

.

|

.

.

.

| Users in Rochester NY

.

.

.

|

Count

3

.

.

.

| All Users in NY

.

.

.

|

Count

3

If you do not specify report breaks, Query prints or displays all the records in the report, one after the
other without any additional spacing or text.

Break level 0 is another level, provided by Query, that you can use. This break level, which occurs only at
the end of the report, is used to print the final summary values for all the specified summary functions at
the end of the report.

Break level 0 has default break text (

FINAL TOTALS), but it can be changed or filled with blanks if you do

not want any final total description or values.

For printed output only, Query suppresses the printing of identical field information within a field that is
defined as a break field. That is, when the contents of a break field are the same in a group of records,
only the first record in the group has that field printed. All the other records in the group do not print the
duplicate contents of that field.

See the previous name and address file example. Even though each record contains a value for the

STATE

field, the value for

STATE only appears in its column when the value changes.

However, for the first record at the top of every page, all the information in all report fields is printed again
for ease of reading.

Query assumes you want a blank line after any summaries, unless you specify a new page. If you display
the information rather than print it, Query ignores new page requests.

Chapter 12. Defining Query for iSeries report breaks

141

Advertising