JUMPTO LABEL command

The JUMPTO LABEL command moves the point at which the program resumes running to the specified label but does not resume running the program.

Read syntax diagramSkip visual syntax diagram JUMPTOJUMP TO LABEL statement_label'statement_label' ;
statement_label
A valid statement label within the currently executing program or, in PL/I, a label variable.

Usage notes

  • For COBOL, if a JUMPTO LABEL command is issued and the specified label contains an EXIT statement, the results might be unpredictable such as an ABEND because the EXIT statement might not be specified with a return location.
  • You can use the JUMPTO command if the SET WARNING is set to OFF and the runtime level allows JUMPTO without compiler enablement for the following programs:
    • A COBOL program compiled without hooks being inserted by the compiler and with optimization, if you compiled with the NOEJPD suboptions of the TEST compiler option
    • A program compiled with Enterprise COBOL for z/OS® Version 5 or later and optimized by Automatic Binary Optimizer for z/OS
    • A program compiled with Open XL C/C++ for z/OS
    The use of JUMPTO in this case might cause unpredictable behaviors, including abends, when the JUMPTO command is executed or followed. You can get the best behavior of JUMPTO in programs that are compiled with OPT and TEST(NOEJPD) options in either of the following situations:
    • When the target of the GOTO or JUMPTO command is a paragraph name or a section name (label).
    • When the target of the GOTO or JUMPTO command is the first statement in the paragraph or section.
    You can get the best behavior especially if these statements are targets of COBOL statements PERFORM or GOTO in the COBOL program. See SET WARNING command (C, C++, COBOL, and PL/I).
  • Use the syntax of statement_label enclosed in apostrophes (') only for LangX COBOL programs. It is not supported in any other programming language.
  • In PL/I, out-of-block JUMPTOs are allowed. However, qualification might be needed.
  • The LABEL keyword is optional when either the target statement_label is nonnumeric or if it is qualified (whether the actual label was nonnumeric or not). A COBOL statement_label can have either of the following forms:
    • name

      This form can be used in COBOL for reference to a section name or for a COBOL paragraph name that is not within a section or is in only one section of the block.

    • name1 OF name2 or name1 IN name2

      This form must be used for any reference to a COBOL paragraph (name1) that is within a section (name2), if the same name also exists in other sections in the same block. You can specify either OF or IN, but z/OS Debugger always uses OF for output.

    Either form can be prefixed with the usual block, compile unit, and load module qualifiers.

  • For C, to be able to use the JUMPTO LABEL command, you must compile your program in one of the following ways:
    • With either the PATH or ALL suboption and the SYM suboption of the TEST compiler option.
    • With either the PATH or ALL suboption and the SYM suboption of the DEBUG compiler option.
    There are no restrictions on using labels with the JUMPTO LABEL command.
  • For C++, to be able to use the JUMPTO LABEL command, you must compile your program in one of the following ways:
    • With the TEST compiler option.
    • With either the PATH or ALL suboption and the SYM suboption of the DEBUG compiler option.
    There are no restrictions on using labels with the JUMPTO LABEL command.
  • For COBOL programs, you can use JUMPTO LABEL command if you compile your program with the following suboptions and compilers:
    • The HOOK suboption of the TEST compiler option with Enterprise COBOL for z/OS, Version 4
    • The PATH or ALL suboption and the SYM suboption of the TEST compiler option with the following compilers:
      • Enterprise COBOL for z/OS and OS/390®, Version 3
      • COBOL for OS/390 & VM, Version 2
    • For Enterprise COBOL for z/OS Version 5, programs are always compiled without hooks inserted by the compiler. If you are using the TEST compiler option in combination with any level of the OPT compiler option, it is recommended to use the EJPD suboption of the TEST compiler option.
    The label can take one of the following forms:
    • name, where name is a section name, or the name of a paragraph not within a section or in only one section of the block.
    • name1 OF name2 or name1 IN name2, where name1 is duplicated by one or more other paragraphs in one or more other sections in the block. You can use either OF or IN, but z/OS Debugger always displays OF in the log.
  • For PL/I, you can use JUMPTO LABEL only if you compiled your program with either the PATH or ALL suboption and the SYM suboption of the TEST compiler option. There are no restrictions on using labels with JUMPTO LABEL and label variables are supported.
  • JUMPTO LABEL is not available while debugging Enterprise PL/I programs.
  • You cannot use the JUMPTO LABEL command while you are replaying recorded steps by using the PLAYBACK commands.
  • You cannot use the JUMPTO LABEL command while you debug an optimized COBOL program.

Examples

  • Jump to the label constant laba in block suba in program prog1.
    JUMPTO prog1:>suba:>laba;
  • Jump to the label constant para OF sect1. The current programming language setting is COBOL.
    JUMPTO LABEL para OF sect1;

Refer to the following topics for more information related to the material discussed in this topic.

  • Related tasks
  • IBM® z/OS Debugger User's Guide
  • Related references
  • statement_label