The LINAGE Clause

The LINAGE clause allows the user to specify the depth of a logical page in terms of number of lines. The user can also specify the size of the top and bottom margins on the logical page, and the line number, within the page body, at which the footing area begins.

It can be specified only for files with sequential organization.

General Format


Syntax for General Format for the LINAGE clause

Syntax Rules

  1. Data-name-1, data-name-2, data-name-3 and data-name-4 must reference elementary unsigned integer data items.
  2. The value of integer-1 must be greater than zero.
  3. The value of integer-2 must not be greater than integer-1.
  4. The value of integer-3 and integer-4 can be zero.

General Rules

  1. The LINAGE clause allows the user to specify the size of a logical page in terms of number of lines. The logical page size is the sum of the values referenced by each phrase except the FOOTING phrase. If the FOOTING phrase is not specified, the values for these functions are zero and no end-of-page condition independent of the page overflow condition exists.

    There is not necessarily any relationship between the size of the logical page and the size of a physical page.

  2. The value of integer-1 or the data item referenced by data-name-1 specifies the number of lines that can be written and/or spaced on the logical page. The value must be greater than zero. That part of the logical page in which these lines can be written and/or spaced is called the page body.
  3. The value of integer-2 or the data item referenced by data-name-2 specifies the line number within the page body at which the footing area begins. The value must be greater than zero and not greater than the value of integer-1 or the data item referenced by data-name-1.

    The footing area comprises the area of the logical page between the line represented by the value of integer-2 of the data item referenced by data-name-2, and the line represented by the value of integer-1 or the data item referenced by data-name-1, inclusive.

  4. The value of integer-3 or the data item referenced by data-name-3 specifies the number of lines that comprise the top margin on the logical page. The value can be zero.

    The value of integer-4 or the data item referenced by data-name-4 specifies the number of lines that comprise the bottom margin on the logical page. The value can be zero.

  5. The value of integer-1, integer-3, and integer-4, if specified, will be used at the time the file is opened by the execution of an OPEN statement with the OUTPUT phrase, to specify the number of lines that comprise each of the indicated sections of a logical page. The value of integer-2, if specified, will be used at that time to define the footing area. These values are used for all logical pages written for the file during a given execution of the run-time element.
  6. The values of the data items referenced by data-name-1, data-name-3, and data-name-4, if specified at the time an open statement with the OUTPUT phrase is executed for the file, will be used to specify the number of lines that are to comprise each of the indicated sections for the first logical page.

    The value of the data item referenced by data-name-2, if specified, will be used at the time an OPEN statement with the OUTPUT phrase is executed for the file to define the footing area for the first logical page.

  7. A LINAGE-COUNTER special register is generated by the presence of a LINAGE clause. The value in the LINAGE-COUNTER special register at any one time represents the line number at which the device is positioned within the current page body. The rules governing the LINAGE-COUNTER special register are as follows:
    1. A separate LINAGE-COUNTER special register is supplied for each file described in the File Section whose file description entry contains a LINAGE clause.
    2. The LINAGE-COUNTER special register can be referenced, but cannot be modified, by Procedure Division statements. Since more than one LINAGE-COUNTER special register can exist in a source element, the user must qualify LINAGE-COUNTER by file-name when necessary.
  8. Each logical page is contiguous to the next with no additional spacing provided.
  9. The values of the data items, at the time a WRITE statement with the ADVANCING PAGE phrase is executed or page overflow condition occurs (see the topic The WRITE Statement), will be used to specify the number of lines that are to comprise each of the indicated sections for the next logical page.
  10. The value of the data item referenced by data-name-2, if specified, will be used at the time a WRITE statement with the ADVANCING PAGE phrase is executed or a page overflow condition occurs, to define the footing area for the next logical page.
  11. The LINAGE-COUNTER special register is automatically modified, according to the following rules, during the execution of a WRITE statement to an associated file:
    • When the ADVANCING PAGE phrase of the WRITE statement is specified, the LINAGE-COUNTER special register is automatically reset to one.
    • When the ADVANCING identifier-2 or integer phrase of the WRITE statement is specified, the LINAGE-COUNTER special register is incremented by integer or the value of the data item referenced by identifier-2.
    • When the ADVANCING phrase of the WRITE statement is not specified, the LINAGE-COUNTER special register is incremented by the value one. (See the topic The WRITE Statement.)
    • The value of the LINAGE-COUNTER special register is automatically reset to one when the device is repositioned to the first line that can be written on for each of the succeeding logical pages. (See the topic The WRITE Statement.)
  12. The value of the LINAGE-COUNTER special register is automatically set to one when an OPEN statement is executed for the associated file.