Informix Error -4313: The NEED statement cannot be used within report headers or trailers.
Cause and resolution
The NEED statement cannot be used within report headers or trailers.
The NEED n LINES statement is used in a a report to cause a conditional page skip. In the context of a FIRST PAGE HEADER, PAGE HEADER, and PAGE TRAILER section, however, it is irrelevant. If it did cause a page skip, an endless loop could ensue.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4313 fires when NEED n LINES appears inside a FIRST PAGE HEADER, PAGE HEADER, or PAGE TRAILER section — per the official guidance, NEED's conditional page skip is irrelevant
there, and if it did trigger a page skip, an endless loop could result.
- A
NEED n LINESstatement inside a header/trailer section, per the official guidance — the direct, only cause.
Solutions / Resolution
- Remove the
NEEDstatement from the header/trailer section.
Examples
NEED inside a page trailer
PAGE TRAILER
NEED 3 LINES
-- -4313: NEED could trigger an endless loop here
PRINT "End of page"
Corrected
PAGE TRAILER
PRINT "End of page"
Diagnostic Checks
- Check every header/trailer section for a
NEEDstatement, and remove it.
Related Errors / Related Topics
- -4312 — "The NEED statement is allowed only within reports." A related
NEED-usage restriction, about being used outside a report entirely rather than inside a header/trailer section. - -4309 — "Printing cannot be done within a loop or CASE statement contained in report
headers or trailers." A related header/trailer restriction, about
PRINTinside loops/CASErather thanNEED.
NEED is used inside a header/trailer section, which could cause an endless loop — remove it.