The example used in 4.4.2 Using the DEF_HEAD Command could be expanded still further to include a page number and some text on the report foot line like this:
GROUP_BY NAME(#ACCOUNT) FIELDS(#COMP #DIV #DEPT
#EXPEND #REVNU)
DEF_HEAD NAME(#HEADING) FIELDS(#COMP #REP1PAGE)
TRIGGER_BY(#COMP *OVERFLOW)
DEF_LINE NAME(#DETAILS) FIELDS(#DIV #DEPT #EXPEND #REVNU)
DEF_FOOT NAME(#FOOTING) FIELDS(#REP1PAGE)
TEXT(('EXP/REV REPORT' 58 10))
SELECT FIELDS(#ACCOUNT) FROM_FILE(ACCOUNTS)
PRINT LINE(#DETAILS)
ENDSELECT
ENDPRINT
This would now produce a 2 page report that looked something like these examples:
Company 01 Page 1
Division Department Expenditure Revenue
1 ADM 400 576
1 MKT 678 56
1 SAL 123 6784
2 ADM 46 52
2 SAL 978 456
3 ACC 456 678
3 SAL 123 679
Page 1 EXP/REV REPORT
Company 02 Page 2
Division Department Expenditure Revenue
1 ACC 843 400
1 MKT 23 0
1 SAL 876 10
2 ACC 0 43
Page 2 EXP/REV REPORT