|Oracle® OLAP DML Reference
11g Release 2 (11.2)
Part Number E17122-05
(Read-only) The LINESLEFT option contains the number of lines left on the current page. The LINESLEFT option is meaningful only when PAGING is set to
YES and only for output from commands such as REPORT and LISTNAMES.
Controlling Page Breaks
LINESLEFT is used primarily in report programs to check the number of lines left on a particular page. When the number of lines left is less than that required for a part of the report that you do not want interrupted by a page break, you can then use a PAGE statement to skip to a new page.
The Effect of PAGESIZE on LINESLEFT
When you change the value of PAGESIZE, the value of LINESLEFT is adjusted accordingly. First, LINESLEFT is subtracted from the old value of PAGESIZE, which gives the lines already used. This result is then subtracted from the new value of PAGESIZE which gives the new value of LINESLEFT. When LINESLEFT becomes less than 1, a new page is started at the next output line.
The Effect of PAGING on LINESLEFT
When you set PAGING to
NO, LINESLEFT is set to the value of PAGESIZE, and it keeps this value until PAGING is set to
YES. When you set PAGING to
YES, LINESLEFT begins counting the lines on the current page.
The Effect of OUTFILE on LINESLEFT
When you use an OUTFILE statement to direct output to a file, LINESLEFT is set to
66 for the file, to match the default value of PAGESIZE. When you set PAGESIZE to a new value for the current outfile, LINESLEFT is adjusted accordingly. For example, assume that you direct output to a file and then set PAGESIZE to
40. In this case, Oracle OLAP sets LINESLEFT to
40 for the file which ensures that the first line of output to the file triggers a new page when PAGING is set to
When you use an OUTFILE statement with the EOF keyword to redirect output to the default outfile, LINESLEFT contains the value that it last held for the default outfile.
Sending LINESLEFT in Output
When you produce output that contains the value of LINESLEFT, the lines that contain this value are never included in the value recorded for LINESLEFT.
Example 5-47 Including a Footnote
In a report, you want a one-line footnote preceded by two blank lines at the bottom of a page. Use the following statements to generate the footnote when three lines remain on the page.
IF LINESLEFT EQ 3 THEN DO BLANK 2 ROW W 50 'Subject To Change Without Notice.' DOEND