Function
The NEXT GROUP clause indicates to the Report Writer the particular line on a page to which the paper is to advance after printing the last line of the report group containing the NEXT GROUP clause, thereby causing the paper to be prepositioned for the next (chronologically speaking) report group to be printed (minimum distance from the next report group).
Format
NEXT GROUP IS {integer-1 | PLUS integer-2 | NEXT PAGE}
Syntax rules
integer-1 and integer-2 must be specified as unsigned integers equal to or greater than 1 . Their value must not exceed 999.
The NEXT GROUP clause must not be specified in a report group description entry unless a LINE clause has been specified.
A NEXT GROUP clause with integer-1 phrase is called an absolute NEXT GROUP clause. After printing the last line of the associated report group, the Report Writer advances the paper to the line whose number is specified by integer-1. This may also involve a page advance, printing the page footing on the previous page and the page heading on the new page (for body groups only).
A NEXT GROUP clause with PLUS integer-2 phrase specified is called a relative NEXT GROUP clause. Positioning is advanced by integer-2 lines from the last print line of the associated report group.
A NEXT GROUP clause with NEXT PAGE phrase specified indicates that the current page is considered to be full; that is, after the associated report group is printed, a page advance is executed (automatic generation of page footing and page heading for body groups).
If in a USE BEFORE REPORTING procedure of a control footing, the PRINT SWITCH special register is set to 1 by a MOVE statement, the function of the NEXT GROUP clause is suppressed by the Report Writer Control System.
General rules
The NEXT GROUP clause may appear only in a 01-level report group description entry.
Rules for the report heading
If the report heading is to appear on a page by itself, its description must contain the NEXT GROUP clause with the NEXT PAGE phrase.
If the report heading is not to appear on a page by itself, the following rules must be observed:
The NEXT GROUP clause must not include the NEXT PAGE phrase.
integer-1 of an absolute NEXT GROUP clause must indicate a line number greater than the one assigned to the last print line of the report heading.
An absolute or relative NEXT GROUP clause must be selected in such a way that the page heading as the next report group can still be contained in its specific region. A positioning to the line with the number integer-d (see "PAGE LIMIT clause") or even to a line which has a higher number owing to the NEXT GROUP clause is illegal.
Rule for the page heading
The NEXT GROUP clause must not be used in describing the page heading.
Rules for body groups
integer-1 of an absolute NEXT GROUP clause must be greater than or equal to integer-d yet less than or equal to integer-f (see "PAGE LIMIT clause").
If the line number integer-1 of the absolute NEXT GROUP clause is less than or equal to the number of the line that was printed as the last line of the body group whose description includes the NEXT GROUP clause, the Report Writer executes a page advance (automatic generation of page footing and page heading included) and positions on the line specified by integer-1.
If a relative NEXT GROUP clause would advance the paper beyond the lower boundary specified by integer-f (see "PAGE LIMIT clause"), the Report Writer executes a page advance (generation of page footing and page heading included) and positions on the upper region boundary specified by integer-d (see "PAGE LIMIT clause").
The NEXT GROUP clause with the NEXT PAGE phrase specified indicates that no further body group is to be written on the current page. The Report Writer positions on the upper region boundary integer-d of the next page (including the creation of page footing and page heading).
If several control footings are created in immediate succession as a result of a control break, the Report Writer can be instructed to execute the function of the NEXT GROUP clause only for the particular control footing associated with the level of hierarchy at which the control break occurred (see section "CBL-CTR special register").
Rule for the page footing
The NEXT GROUP clause must not be used in describing the page footing.
Rule for the report footing
The NEXT GROUP clause must not be used in describing the report footing.
Example 10-6
01 LINE PLUS 2 NEXT GROUP PLUS 1. TYPE CONTROL FOOTING WDAY. 02...
The NEXT GROUP clause causes the Report Writer to advance only one line after the above control footing is created.