Previous Topic: Invalid Labels:

Next Topic: Undefined Labels

Label Variables

A variable can be specified as the target of an &GOTO or &GOSUB statement. This variable, after variable substitution, is then taken as a label to which a branch is required.

Example: Label Variables

&GOTO .&MSGID

can read, after variable substitution:

&GOTO .IST350I

and a search for the label .IST350I is made.

Usually, most information input to a procedure contains a unique identifier such as a message number. The ability to branch to a label variable makes it possible to use this unique message number and branch directly to the part of the procedure concerned with processing the message, instead of having to use a number of &IF statements to determine the processing required.