The Informix precompiler provides a FREE statement that will release resources that are allocated to a prepared statement or to a cursor.
Once you have finished with a prepared statement, you would then use the FREE statement, for example:
move "INSERT INTO publishers " " & "VALUES (?,?,?,?)" to stmtbuf EXEC SQL PREPARE stmt1 FROM :stmtbuf END-EXEC ... EXEC SQL EXECUTE stmt1 USING :pubid,:pubname,:city,:state END-EXEC. ... EXEC SQL FREE stmt1 END-EXEC