Informix Error -4397
-4397 The IF statement at line line-number is not terminated.
4GL could not identify an END IF statement to match the IF statement on the line number shown. Start at that line and work down until you find where the terminating statement should have been, and insert it.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4397 fires when the compiler can't find an END IF to match an IF statement — per the
official guidance, start at the reported line and work downward to find where the terminator
should have been.
- An
IFstatement with no matchingEND IF, per the official guidance — the direct, only cause.
Solutions / Resolution
- Start at the reported line and work down until you find where
END IFshould have been, then insert it, per the official guidance.
Examples
A missing END IF
IF status = "New" THEN
CALL initialize()
-- -4397: no END IF found
Corrected
IF status = "New" THEN
CALL initialize()
END IF
Diagnostic Checks
- Work down from the reported
IFline, and insert the missingEND IFat the correct point.
Related Errors / Related Topics
- -4396 — "The MENU declaration at line line-number is not terminated." The same
missing-terminator pattern applied to
MENU/END MENUinstead ofIF/END IF. - -4389 — "There are too many levels of nesting of IF statements in this report." A
related
IF-nesting error, which a missingEND IFcan also cause by making subsequentIFstatements appear more deeply nested than intended.
An IF statement has no matching END IF — insert one at the correct point.