The TAG statement identifies the branch location for a WHENEVER statement in ILE RPG. The statement can be used to define a host-label instead of defining the label directly with an RPG TAG operation.
This statement can only be embedded in an ILE RPG application program. It is not an executable statement.
- Specifies the label to use for generating an ILE RPG TAG operation. This is intended to identify the next executable statement for the GOTO clause of a WHENEVER statement.
SQL does not verify the position of the TAG statement or the uniqueness or value of host-label. The ILE RPG compiler must allow a TAG operation at the SQL TAG statement's location.
In a free-form ILE RPG program, continue processing at HANDLER for an SQL statement that produces an error.
EXEC SQL WHENEVER SQLERROR GOTO HANDLER; ... EXEC SQL TAG HANDLER;