Capturing COBOL I/O to the system console

To redirect output normally appearing on the system console to your z/OS® Debugger terminal, enter the following command:
SET INTERCEPT ON CONSOLE ;

Example: sample COBOL program for debugging

For example, if you run COBCALC and issue the z/OS Debugger SET INTERCEPT ON CONSOLE command, followed by the STEP 3 command, you will see the following output displayed in the z/OS Debugger Log window:
SET INTERCEPT ON CONSOLE ;
STEP 3 ;
CONSOLE : CALC Begins.
The phrase CALC Begins. is displayed by the statement DISPLAY "CALC Begins." UPON CONSOLE in COBCALC.
The SET INTERCEPT ON CONSOLE command not only captures output to the system console, but also allows you to input data from your z/OS Debugger terminal instead of the system console by using the z/OS Debugger INPUT command. For example, if the next COBOL statement executed is ACCEPT INPUT-DATA FROM CONSOLE, the following message appears in the z/OS Debugger Log window:
CONSOLE : IGZ0000I AWAITING REPLY.
The program is waiting for input from CONSOLE.
Use the INPUT command to enter 114 characters for the intercepted
fixed-format file.
Continue execution by replying to the input request by entering the following z/OS Debugger command:
INPUT some data ;
Note: Whenever z/OS Debugger intercepts system console I/O, and for the duration of the intercept, the display in the Source window is empty and the Location field in the session panel header at the top of the screen shows Unknown.