Informix Error -4362: The report cannot skip to the top of page while in a header or trailer.
Cause and resolution
The report cannot skip to the top of page while in a header or trailer.
When SKIP TO TOP OF PAGE is executed, the page trailer clause must be executed (so as to display fixed page-end material) followed by the page header clause. If the statement was allowed in a header or trailer clause, an infinite loop could ensue.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4362 fires when SKIP TO TOP OF PAGE is executed from within a header or trailer clause —
per the official guidance, executing it there could trigger an infinite loop, since
SKIP TO TOP OF PAGE itself needs to run the trailer, then the header, in sequence.
SKIP TO TOP OF PAGEexecuted from within a header or trailer clause, per the official guidance — the direct, only cause.
Solutions / Resolution
- Move the
SKIP TO TOP OF PAGEstatement outside any header/trailer clause, per the official guidance — typically into the detail (ON EVERY ROW) processing instead.
Examples
SKIP TO TOP OF PAGE inside a page trailer
PAGE TRAILER
SKIP TO TOP OF PAGE
-- -4362: this could cause an infinite loop
Corrected
ON EVERY ROW
IF need_new_page THEN
SKIP TO TOP OF PAGE
END IF
Diagnostic Checks
- Check every header/trailer clause for a
SKIP TO TOP OF PAGEstatement, and move it into detail processing instead.
Related Errors / Related Topics
- -4363 — "The report cannot skip lines while in a loop within a header or trailer." A
related header/trailer restriction, about
SKIPstatements inside loops rather thanSKIP TO TOP OF PAGEspecifically.
SKIP TO TOP OF PAGE is executed from within a header/trailer, which could loop
infinitely — move it into detail processing.