GOTO command
The GOTO command causes z/OS® Debugger to resume
program execution at the specified statement id. The GOTO keyword
cannot be abbreviated. If you want z/OS Debugger to return
control to you at a target location, make sure there is a breakpoint
at that location.
Usage notes
- You can use the GOTO command if the SET WARNING is set to OFF and
the runtime level allows GOTO 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
- 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
cannot use the
GOTOcommand while you debug a disassembled program. - If
GOTOis specified in a command list (for example, as the subject of anIFcommand orWHENclause), all subsequent commands in the list are ignored. - Statement
GOTO's are not restricted if the program is compiled with minimum optimization. - The
GOTOcommand cannot be used while you replay recorded statements by using thePLAYBACKcommand. - For C, C++, and PL/I, statements can be removed by the compiler
during optimization, specify a reference or statement with the
GOTOcommand that can be reached during program execution. You can issue theLIST STATEMENT NUMBERScommand to determine the reachable statements. - PL/I allows
GOTOin a command list on a call toPLITESTorCEETEST. - In PL/I, out-of-block
GOTOs are allowed. However, qualification might be needed. - For
COBOL, the
GOTOcommand follows the COBOL language rules for theGOTOstatement. You can use theGOTOcommand in the following situations:- A COBOL program compiled with hooks inserted by the compiler.
If you are using Enterprise COBOL for z/OS,
Version 4, compile your program with the
HOOKsuboption of theTESTcompiler option. If you are using any of the following compilers, compile your program with eitherPATHorALLsuboption and theSYMsuboption of theTESTcompiler option:- Enterprise COBOL for z/OS and OS/390®, Version 3
- COBOL for OS/390 & VM, Version 2
- A COBOL program compiled without hooks inserted by the compiler
and without optimization. If you are using Enterprise COBOL for z/OS, Version 4, compile your program
with the
NOHOOKsuboption of theTESTcompiler option. If you are using any of the following compilers, compile your program with theNONEsuboption of theTESTcompiler option:- Enterprise COBOL for z/OS and OS/390, Version 3 Release 2 or later
- Enterprise COBOL for z/OS and OS/390, Version 3 Release 1, with APAR PQ63235 installed
- COBOL for OS/390 & VM, Version 2 Release 2
- COBOL for OS/390 & VM, Version 2 Release 1, with APAR PQ63234 installed
- A COBOL program compiled without hooks inserted by the compiler
and with optimization. You must compile your program with Enterprise
COBOL for z/OS, Version 4,
and specify the
EJPDandNOHOOKsuboption of theTESTcompiler option. Specifying theEJPDsuboption might cause some loss of optimization. - 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.
- A COBOL program compiled with hooks inserted by the compiler.
If you are using Enterprise COBOL for z/OS,
Version 4, compile your program with the
- This command cannot be used if you are stopped at an AT APPEARANCE breakpoint, an AT LOAD breakpoint, or an AT DELETE breakpoint.
Examples
- Resume execution at statement 23, where statement 23 is in a currently
active block.
If there's no breakpoint at statement 23, z/OS Debugger will run from statement 23 until a breakpoint is hit.GOTO 23; - Resume execution at statement 45, where statement 45 is in a currently
active block.
AT 45 GOTO 45
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_id
