Syntax
ADVANCE { numeric_literal | NEWPAGE | CHANNEL numeric_literal } [AS outputstream]
Parameters
Advance can be abbreviated as AV.
numeric_literal
The number of lines to advance.
NEWPAGE
Advances the report to a new page.
CHANNEL numeric_literal
Advances report printing to the channel number specified by the numeric literal.
This command option is restricted to reports directed to an LP device. It is intended for printing on special stationery.
AS outputstream
Restricts the effect of this logic command to the specified outputstream. If the ‘As’ option is not specified, the command applies to the default outputstream
Description
The Advance logic command is used in reports or outputstreams to advance to a new page or by a specified number of lines between frames. It can also be used to advance report printing to a specified channel number.
Page headings resulting from an Advance logic statement are not produced until further output is produced, so that:
Headings can be changed after an Advance logic statement; but before output.
Reports do not produce a final headings-only page.
Advance NewPage
For ROC reports or non-ROC MCP-based TP Reports, the Advance NewPage logic command variant is ignored if no report output has been produced, since all reports start at top-of-page.
For DEPCON reports, the Advance NewPage logic command variant writes a $NEWPAGE$ command to the output file. All other Advance logic command variants are ignored in DEPCON reports.
For MCP-based non-ROC Reports that output to LP or RP, the Advance NewPage command produces footers, a new page, and headings whenever it is executed.
Advance Channel
For MCP and Windows-based systems, the Advance Channel command variant can be used for Reports directed to an LP device. It is intended for printing on special stationery.
For reports directed to TP (or RP devices in MCP-based systems), if the Advance Channel logic command variant is invoked with channel number 1 (Advance Channel 1), the report is advanced to end-of-page. Any other channel number advances the report by one line. If end-of-page is passed, the Glb.PageCount built-in segment attribute is not incremented and no headings are printed. The Glb.LineCount built-in segment attribute is incremented by one.
Example
BeginPage Frame01 : Invokes a print of Frame01. Advance 4 : Will not print on first page. BeginPage Frame03 Determine Actual Withdraws Frame04.Print() End If Glb.LineCount > 55 Advance NewPage End If Customer <> LastCust If Glb.Machine = 1 Advance 3 Else Advance Channel 6 End End
For Standard ROC Reports, the COBLPFORM variable must be set when you initiate the ROC Output Report, not when the Report is run. For Direct Reports, the COBLPFORM variable must be set when the Report is run. Refer to Micro Focus COBOL for UNIX COBOL System Reference for more information.