|Oracle® OLAP DML Reference
11g Release 2 (11.2)
Part Number E17122-05
FILEPAGE fileunit [n]
A fileunit number assigned to a file that is opened in WRITE or APPEND mode by a previous call to the FILEOPEN function or by the OUTFILE command.
INTEGER expression that indicates a page break should occur when there are fewer than n lines left on the page. When the number of lines left equals or exceeds n, or n equals zero, no page break occurs. When n is greater than PAGESIZE, a page break occurs when LINENUM is not zero. When n is negative or omitted, a page break always occurs.
Oracle OLAP calculates the number of available lines left on the page using the values of the options that specify the page size, the current line number, and the bottom margin. The number, which is stored in LINELEFT, is calculated according to the following formula.
LINESLEFT = PAGESIZE - LINENUM - BMARGIN
Using PAGE Instead of FILEPAGE
The PAGE command has the same effect as specifying the FILEPAGE command for the fileunit number OUTFILEUNIT, which is the number of the current outfile destination. The following two statements are equivalent.
FILEPAGE OUTFILEUNIT PAGE
Example 9-123 Using the FILEPAGE Command
In the following program fragment, you might send a FILEPAGE statement when you know the next group of products does not fit on the page. The program takes as arguments the name of the output file, and three
month dimension values.
fil.unit = FILEOPEN(ARG(1) WRITE) LIMIT month TO &ARG(2) &ARG(3) &ARG(4) COMMAS = NO DECIMALS = 0 FOR district DO FILEPAGE fil.unit STATLEN(product) FOR product DO FIL.TEXT = product FOR month JOINCHARS(fil.text ' ' CONVERT(sales TEXT)) FILEPUT fil.unit fil.text DOEND FILEPUT fil.unit '' DOEND FILECLOSE fil.unit