Function
The LINE clause specifies the line on the report page on which one or more printable items defined within its scope (see section "COLUMN clause") are to be printed. In special application, it is used simply for page advance.
Format
LINE NUMBER IS {integer-1 | PLUS integer-2 | NEXT PAGE}
Syntax rules
integer-1 and integer-2 may only be specified as unsigned integers. integer-1 must be greater than or equal to 1, integer-2 must be greater than or equal to 0. The value of integer-1 or integer-2 must not exceed 999.
A LINE clause with integer-1 phrase specified is called an absolute LINE clause. integer-1 is interpreted as a line number. Therefore, when creating the associated report group, integer-1 indicates the particular line on the report page on which the printable items which belong to the LINE clause and, thus, are organized as a line will ultimately be written. In this way, an absolute LINE clause always defines a print line.
A LINE clause with PLUS integer-2 phrase specified is called a relative LINE clause. The print line to receive the printable items associated with a relative LINE clause at the time the particular report group is generated, is determined relative to the last vertical positioning. For this purpose, integer-2 is added to the number of the line on which the report page is presently positioned (see section "NEXT GROUP clause" and section "LINE-COUNTER special register"). The sum then designates the number of the next line to be printed.
Deviations from the above rules are only permissible for special types of report groups, when the relative LINE clause was used for the first line of a report group. These deviations will be discussed in due course.
A LINE clause with a NEXT PAGE phrase causes the associated report group to be printed on a free page (usually the next page), advancing the page before the report group is printed.
Whether a LINE NEXT PAGE clause additionally specifies a print line can be seen from the rules described below.
General rules
The following programming rules are classified into two categories -"General notes" and "Report group syntax notes". Rules in the latter category describe the use of the LINE clause in the descriptions of the different types of report groups.
The abbreviations used in the report group notes have the following meaning.
Abbreviation | Meaning |
A | one or more absolute LINE clauses |
R | one or more relative LINE clauses |
NP | a LINE clause with NEXT PAGE phrase |
A printable report group item that is to be written on a line of the report page must either itself contain a LINE clause in its description or its description must be preceded, within the associated report group description entry, by a LINE clause. Conversely, all printable items in the associated report group description entry, which follow the LINE clause and precede the next LINE clause or the end of that report group description entry, will be written on the line determined by the LINE clause. Subsequent printable items from the report group entry are printed combined into lines in the same manner.
The vertical spacing parameters (LINE and NEXT PAGE clauses) must be selected for the different report group types in such a way that these report groups can be printed within the page regions provided for them (see section "PAGE LIMIT clause" and section "TYPE clause"). It is not possible to continue a report group in the associated specific region on another page.
If a body group cannot be printed in its specific region simply because part of that region is no longer available, then that body group as a whole will be written in the same region on the next page, after creating first the page footing on the old page and the page heading on the new page.
If a report group entry includes (one or more) absolute LINE clauses, they must all be specified:
preceding the first relative LINE clause if any, and
in the order of ascending integers.
The LINE clause with the NEXT PAGE phrase may only be specified in a report group description entry (01 level) to position to the next page.
Report group syntax notes
Report heading
The following sequences of LINE clauses may be used in describing a report heading group:
{A | A R}
Page heading
Only the following sequences of LINES clauses may be used in describing a page heading group:
{A | A R | R}
When the first LINE clause from the description of the page heading is a relative clause, then, generally, the first line of the report group is printed relative to the region boundary integer-h of the PAGE LIMIT clause (see section "PAGE LIMIT clause"). Only when the report heading was printed on the same page will there be deviation in that the first line of the report group is printed relative to the vertical spacing resulting from the creation of the report group heading.
Body groups
Detail groups, control headings, and control footings are referred to generically as body groups.
The following sequences of LINE clauses may be used in describing a body group:
{NP | NP A | NP A R | NP P | A | A R | R}
When NP A or NP A R sequences are specified for a LINE NEXT PAGE clause, NP provides page changing instructions, and does not define a print line. Thus, the first absolute LINE clause must appear with, or prior to, the first entry defining a printable item.
If a LINE clause with NEXT PAGE phrase is specified as the only LINE clause or with the sequence NP R, this implies not only page advance but also vertical
spacing of the first line of that report group.A LINE NEXT PAGE clause in the description of a body group indicates to the Report Writer that the body group is to be printed on the next page which is not yet occupied by a body group. This may lead to a situation where no page advance is carried out. This will certainly be the case when the body group is to be written as the first body group on a particular report.
If a body group defined with a LINE clause sequence NP, NP R, or R is the first body group to be printed on a page, then the first print line of that body group will be printed on the line whose number is integer-d as specified in the PAGE clause. However, it may well be the case that the paper has already been advanced beyond region boundary integer-d, e.g. through the last body group printed because of a NEXT GROUP clause (see section "NEXT GROUP clause"). In this case, the first line of the body group will be written on the line immediately following the present positioning.
If a body group whose first LINE clause is relative is not to be printed as the first body group on a page, the present positioning (line number) is advanced by the number of lines specified by integer-2 in the first LINE clause, to the new position where the first line of this report group will be printed.
Page footing
Only the following sequences of LINE clauses may be used in describing a page footing:
{A | A R}
Report footing
The following LINE clause sequence alternatives may be used in describing a report footing:
{NP A | NP A R | A | A R | R}
The LINE clause with the NEXT PAGE phrase specified is used solely for page advance.Therefore, the first absolute LINE clause must appear with, or prior to, the description of the first printable item, in order to permit positioning to the first line of the report group.
Example 10-4
01 DETAIL-GROUP TYPE DETAIL LINE NEXT PAGE. 02 LINE 10 COLUMN 1 PIC X(10) VALUE "1ST ITEM". 02 COLUMN 15 PIC X(4) SOURCE CARD-FIELD-1. 02 LINE 12 COLUMN 1 PIC X(10) VALUE "2ND ITEM". 02 COLUMN 15 PIC 9(5) SOURCE-WORK-FIELD-1.
The two-line detail group is printed on lines 10 and 12 of a page not yet used for other body groups, because the LINE clause sequence is NP A.
Example 10-5
01 DETAIL-LINE LINE PLUS 1 TYPE DETAIL. 02 COLUMN 2 GROUP INDICATE PIC A(9) SOURCE FIELD-NO-1.
This example shows a report group whose description includes only one relative LINE clause. The report group will be printed on the line resulting from the present position being advanced by one line. If the report group is to be printed as the first body group on that page, and the present positioning has not gone beyond the integer-d region boundary (FIRST DETAIL phrase if the PAGE LIMIT clause), the report group is printed to the line whose number is integer-d.