The WHENEVER statement is not supported by the SQL/REXX interface. You can use one of several substitutes, however.
Any of the following may be used instead:
This can be used to detect errors and warnings issued by either the database manager or by the SQL/REXX interface.