Database :
PRODUCT BRANCH SALES
┌─────────────────────────────────────┐
Record 1 │ Color TV Boston 2ðð │
Record 2 │ Color TV Chicago 5ðð │
Record 3 │ Color TV Los Angeles 1ððð │
Record 4 │ Color TV Miami 1ðð │
Record 5 │ Color TV San Francisco 8ðð │
Record 6 │ Color TV St. Louis 4ð │
Record 7 │ Color TV Washington 3ðð │
Record 8 │ Radio Denver 1ðð │
Record 9 │ Radio Milwaukee 2ðð │
Record 1ð │ Radio Santa Fe 6ð │
Record 11 │ Radio Boca Raton 3ðð │
Record 12 │ Video New York 5ðð │
. . . .│
. . . .│
└─────────────────────────────────────┘
6
┌─────────────────────────────────────────────────────┐
│ PFD Definition :
│ - Place four records in a page
│ - PRODUCT is the break field
│ - Specify the summary data of SALES for a page
│ - Specify the summary data of SALES for page break
└─────────────────────────────────────────────────────┘
│ Print the database file with the PFD definition
6
Page 1
┌─────────────────────────────────────────────────────┐
│ Placed Records : Record 1
Record 2
Record 3
Record 4
│ Summary data of SALES for page
First value : 2ðð (from Record 1)
Last value : 1ðð (from Record 4)
Total : 18ðð (from Record 1-4)
Average : 45ð (Total/record count)
Maximum : 1ððð (from Record 3)
Minimum : 1ðð (from Record 4)
Record count: 4
│ Summary data of SALES for page break
First value : Not printed
Last value : Not printed
Total : Not printed
Average : Not printed
Maximum : Not printed
Minimum : Not printed
Record count: Not printed
└─────────────────────────────────────────────────────┘

Note: The page break does not occur on the page 1 because the value of the

PRODUCT field does not change. Therefore, summary data for page break

is not printed.

174 AFP Utilities for AS/400 User’s Guide