Contents - Index


 

Use ProcGoto within a procedure to branch (i.e. transfer command processing) to the command after the corresponding ProcLabel command.

 

ProcGoto may also be entered as Goto.

 

Required Operands

 

LABEL is a name specified on a ProcLabel statement.  If the label precedes the ProcGoto, prefix the label with a dash (-).

 

ProcGotos are either forward (to a label following the ProcGoto) or backward (to a label preceding the ProcGoto).  Whenever a backward ProcGoto is executed, predefined variable PPDLPCTR is incremented.  When the value of PPDLPCTR exceeds the value of PPDLPLMT, the ProcGoto will fail.  PPDLPLMT is initialized to 1000.

 

Return Codes

 

OK Successful.

 

Examples

 

The following example shows how the ProcGoto command could be used within a procedure that processes a sequence of statements 12 times:

 

 ------------------------------------------------------------------------

 DECLARE COUNTER,NUM,6,V

 SET COUNTER,0

 LABEL D20

 ADD COUNTER,1

 IF COUNTER,GT,12

     GOTO E20

   .... lines to be processed 12 times ....

 GOTO -D20

 LABEL E20

 ------------------------------------------------------------------------