LINAGE Clause

The LINAGE clause specifies the depth of a logical page in terms of number of lines. Optionally, it also specifies the line number at which the footing area begins, as well as the top and bottom margins of the logical page. (The logical page and the physical page don't necessarily have to be of the same size.)

The LINAGE clause can be specified only for files assigned to the device PRINTER. See ASSIGN Clause.

IBM® i printer files offer a number of powerful features through DDS that can be used to advantage. Such files are declared in ILE COBOL programs as FORMATFILE. For more information on printer files, see the DB2® for i section of the Database and File Systems category in the IBM i Information Center at this Web site - http://www.ibm.com/systems/i/infocenter/.

Read syntax diagramSkip visual syntax diagram
LINAGE Clause - Format

>>-LINAGE--+----+--+-data-name-3-+--+-------+------------------->
           '-IS-'  '-integer-8---'  '-LINES-'   

>--+--------------------------------------------+--------------->
   '-+------+--FOOTING--+----+--+-data-name-4-+-'   
     '-WITH-'           '-AT-'  '-integer-9---'     

>--+-----------------------------------------+------------------>
   '-+-------+--+----+--TOP--+-data-name-5-+-'   
     '-LINES-'  '-AT-'       '-integer-10--'     

>--+--------------------------------------------+--------------><
   '-+-------+--+----+--BOTTOM--+-data-name-6-+-'   
     '-LINES-'  '-AT-'          '-integer-11--'     

The LINAGE clause does not affect the number of lines in the selected device file; it only affects the logical page mechanism within the COBOL program.

At execution time, the printer file being used determines the physical page size. This information is used to issue appropriate space and eject commands to produce the logical page as defined in the LINAGE clause. Thus, the logical page can contain multiple physical pages, or one physical page can contain multiple logical pages.

All integers must be unsigned. All data-names must be described as unsigned integer data items.
data-name-3, integer-8
The number of lines that can be written and/or spaced on this logical page. The area of the page that these lines represent is called the page body. The value must be greater than zero.
WITH FOOTING AT
Integer-9 or the value in data-name-4 specifies the first line number of the footing area within the page body. The footing line number must be greater than zero, and not greater than the last line of the page body. The footing area extends between those two lines.
LINES AT TOP
Integer-10 or the value in data-name-5 specifies the number of lines in the top margin of the logical page. The value may be zero.
LINES AT BOTTOM
Integer-11 or the value in data-name-6 specifies the number of lines in the bottom margin of the logical page. The value may be zero.

Figure 1 illustrates the use of each phrase of the LINAGE clause.