Informix Error -4426
-4426 The PRINT statement can be used only within reports. If you wish to
print without screen positioning, use the DISPLAY statement without any field or screen destination.The keyword PRINT is used specifically to produce lines of output to a report. The keyword DISPLAY introduces output to the screen. Possibly this statement was accidentally copied from a report body; more likely it was a hasty attempt to display casual output on the screen. In the latter case, simply changing PRINT to DISPLAY is usually enough.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4426 fires when PRINT is used outside a report — per the official guidance, PRINT
produces report output lines specifically, while DISPLAY writes to the screen; this often
happens from code accidentally copied from a report body, or a hasty attempt at casual screen
output.
PRINTused outside a report function, per the official guidance — the direct, only cause.
Solutions / Resolution
- Change
PRINTtoDISPLAY(with no field/screen destination) if casual screen output was intended, per the official guidance — usually sufficient on its own.
Examples
PRINT used outside a report
FUNCTION debug()
PRINT "Debugging: ", value
-- -4426: PRINT is only valid inside a report
END FUNCTION
Corrected
FUNCTION debug()
DISPLAY "Debugging: ", value
END FUNCTION
Diagnostic Checks
- Check whether the flagged
PRINTstatement is inside a report, and change it toDISPLAYif casual screen output was intended.
Related Errors / Related Topics
- -4417 — "This type of statement can be used only in a report." A closely related,
broader restriction covering
PRINT,SKIP,NEED, and similar report-only statements.
PRINT is used outside a report — change it to DISPLAY for casual screen output.