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 │
. │ . . .│
. │ . . .│
└─────────────────────────────────────┘
│
│
┌─────────────────────────────────────────────────────┐
│ 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
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