Start of change

TAG

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.

Invocation

This statement can only be embedded in an ILE RPG application program. It is not an executable statement.

Authorization

None required.

Syntax

Read syntax diagramSkip visual syntax diagramTAGhost-label

Description

host-label
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.

Note

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.

Example

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;
End of change