The LINAGE clause is used to specify the number of lines on a logical page, and optionally provide margin information.
LINAGE IS page-lines LINES
[ WITH FOOTING AT footing-line ]
[ LINES AT TOP top-lines ]
[ LINES AT BOTTOM bottom-lines ]
- page-lines is a numeric literal or numeric data item whose value must be a positive integer. It specifies the number of lines on the
page-lines may be qualified.
- footing-line is a positive integer or numeric data item. Its values must be greater than zero and less than or equal to
page-lines. It specifies the line number where the footing area begins on the page.
footing-line may be qualified.
- top-lines and
bottom-lines are integers or numeric data items. Their values must be greater than or equal to zero. They represent the numbers of lines
in the top and bottom margins respectively.
bottom-lines may be qualified.
- The LINAGE clause may be specified for a Sequential file only.
- The LINAGE clause specifies the number of lines on a logical page. The total page size is the sum of
bottom-lines. If the TOP or BOTTOM phrase is omitted, the corresponding value is treated as zero. Note that
footing-line is not added to the page size.
- page-lines specifies the size of the page body. This is the area of the logical page in which the program can write or space lines.
- Each logical page follows the preceding logical page with no additional spacing. ACUCOBOL-GT does not provide physical page
ejects (form-feeds) when the LINAGE clause is used. Device positioning occurs by line spacing rather than by page ejection.
- The footing area is composed of the area between
page-lines, inclusive. The footing area causes a page-overflow condition when written in. If the FOOTING phrase is omitted, there is
no footing area.
- Evaluation of the logical page size occurs as follows:
- When the file is opened with the OUTPUT or EXTEND phrases, the LINAGE clause values are evaluated and applied to the first
logical page. The device is assumed to be positioned at the beginning of the logical page.
- When the program executes a WRITE statement with the ADVANCING PAGE option, or when a page-overflow condition occurs, the
LINAGE clause values are evaluated and applied to the next logical page.
- For each file that has a LINAGE clause associated with it, the compiler creates an implicit data item called LINAGE-COUNTER
associated with that file. If more than one file in the program specifies a LINAGE clause, reference to a LINAGE-COUNTER will
have to be qualified by the appropriate file name. The LINAGE-COUNTER is an elementary numeric data item that contains the
same number of digits as
- At any time, the value of LINAGE-COUNTER is the line number in the current page body at which the device is positioned.
- LINAGE-COUNTER may be treated as a normal numeric data item except that it may never be explicitly modified by the program.
- The LINAGE-COUNTER is set to one when the file is opened.
- Every WRITE statement that refers to a file with a LINAGE clause affects the associated LINAGE-COUNTER in the following manner:
- If the WRITE statement has the ADVANCING PAGE phrase, the LINAGE-COUNTER is set to one.
- If the WRITE statement has the ADVANCING LINES phrase, the LINAGE-COUNTER is incremented by the value in the ADVANCING phrase.
- If the WRITE statement does not have an ADVANCING phrase, the LINAGE-COUNTER is incremented by one.