GOTO (continue processing at label with suffix)


GOTO branches to the PRL marked by a label ending with a colon (:) sign.

Execution continues at the first statement following the label.

Syntax

GOTO label

where

  • GOTO directs program flow to another set of PRL statements.
  • label is the name of a set of PRL statements. The label must have a colon (:) suffix.

    The label is alphanumeric, can include special characters but no blank characters, and must end with a colon (:) sign. The label should be on a line by itself and must be unique. It can be any length and can start in any column, as follows:

IF V1 = V2 THEN GOTO LABEL
           statement
           statement
LABEL:
           statement
           END

 

Example

SELECT TYPE 6E AND 6D RECORDS FROM CMRDETL
      WHERE T6ETMID ¬= '    '
    IF TYPE = '6D' THEN GOTO ABEND
    SET CIC = T6ETRID(1:1)
    IF CIC = 'C' THEN GOTO CICS
ABEND:
    SET REPORTID = 'TRANAB'
    SET TITLE = 'TRANSACTIONS THAT ABENDED'
    SET CLASS = 'R'
    USING CMRDATE CMRTIME T6ERESP T6ECPUR T6ETRID T6EOPID T6ETMID
    REPORT
CICS:
    SET REPORTID = 'CICSTRAN'
    SET TITLE = 'CICS-SUPPLIED TRANSACTIONS'
    SET CLASS = 'R'
    SET HH = &CMRTIME(1:4)
    SET TIME = '&HH.0  '
    USING TIME T6ETMID T6EOPID T6ECPUR T6ETCWT T6ETRID T6ERESP
    DETAIL
    REPORT
    END

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*