Informix Error -8112
-8112 Within an IF-THEN-ELSE statement of a header or trailer clause, the
number of lines printed in the IF part must equal the number of lines printed in the ELSE part.ACEPREP needs to know how many lines will be filled in header and trailer sections (otherwise, it does not know how many detail rows to put on the page). Because it cannot tell which part of an IF statement will be executed, it requires that both produce the same number of lines of output.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-8112 fires when an IF/ELSE inside a header/trailer prints a different number of lines
in each branch — per the official guidance, ACEPREP can't predict which branch executes, so
both must produce the same line count.
- The
IFbranch andELSEbranch printing different numbers of lines, per the official guidance — the direct, only cause.
Solutions / Resolution
- Adjust the
IF/ELSEbranches so both print the same number of lines, per the official guidance — e.g. by adding a blankPRINT/SKIPto the shorter branch.
Examples
Mismatched branch line counts
PAGE HEADER
IF status = "Active" THEN
PRINT "Status: Active"
PRINT "Details follow"
ELSE
PRINT "Status: Inactive"
END IF
-- -8112: IF prints 2 lines, ELSE prints 1
Corrected
PAGE HEADER
IF status = "Active" THEN
PRINT "Status: Active"
PRINT "Details follow"
ELSE
PRINT "Status: Inactive"
SKIP 1 LINE
END IF
Diagnostic Checks
- Count the lines printed in each branch of every header/trailer
IF/ELSE, and balance them.
Related Errors / Related Topics
- -8109 — "Wordwrap may not be used within PAGE HEADERS or TRAILERS." A related
header/trailer line-count-predictability restriction, about
WORDWRAPrather than mismatchedIF/ELSEbranches. - -8114 — "The number of lines to be printed in the top and bottom margins plus the lines to be printed in the page header and trailer clauses exceeds or equals the page length." A related header/trailer line-count restriction, about total page fit rather than branch balance.
A header/trailer IF/ELSE prints different line counts in each branch — balance them.