The LINAGE clause is used to specify the number of lines on a logical page, and optionally provide margin information.

General Format

LINAGE IS page-lines LINES

   [ WITH FOOTING AT footing-line ]

   [ LINES AT TOP top-lines ]

   [ LINES AT BOTTOM bottom-lines ]

Syntax Rules

  1. 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 logical page. page-lines may be qualified.
  2. 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.
  3. 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. top-lines and bottom-lines may be qualified.
  4. The LINAGE clause may be specified for a Sequential file only.

General Rules

  1. The LINAGE clause specifies the number of lines on a logical page. The total page size is the sum of page-lines, top-lines, and 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.
  2. 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.
  3. 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.
  4. The footing area is composed of the area between footing-line and 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.
  5. 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.
  6. 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 page-lines.
  7. At any time, the value of LINAGE-COUNTER is the line number in the current page body at which the device is positioned.
  8. LINAGE-COUNTER may be treated as a normal numeric data item except that it may never be explicitly modified by the program.
  9. The LINAGE-COUNTER is set to one when the file is opened.
  10. 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.