This part of the CICS tutorial shows how to use a debugger to walk through an employee directory PL/I sample application. It explains pertinent parts of the application and debugger functionality.
Before you start debugging, connect to the enterprise server using a TN3270 emulator such as
Micro FocusRumba. Your host name is
localhost, and the port number is
5150. This tutorial assumes that you are using
Rumba for hosting.
Logging in and starting the application in CodeWatch Debugger
- Start
Micro FocusRumba and create a new mainframe display.
- Choose
. The Signon to CICS screen appears in the mainframe display.
- Type a user ID and password. These would typically be
SYSAD and
SYSAD. Press the
Tab key to move from the ID field to the Password field.
- Press
Enter.
- Press
Ctrl + Shift + Z to clear the screen if using Micro Focus Rumba. If using a different terminal emulator, follow instructions for that emulator to clear its screen.
- Type
TTEA and press
Enter to start the sample application. A message appears asking you if you want to debug the PL/I program STAFF02. To see data returned by the program while stepping through code, data must be supplied. At this point, since no data has been supplied to the program, Click
No to return to the application.
- In the
Name field type
WILLIAMS and press
Enter. A message appears asking if you want to debug the PL/I program STAFF02.
- Click
Yes. The CodeWatch debugger window appears. The debugger displays the STAFF02 program and moves to the first line of the program code. If using
Rumba to connect to the enterprise server, a
Rumba terminal log window also appears.
Stepping through the CICS mapset in the STAFF02 Program
The code for the STAFF02 program receives data from the CICS mapset. This part of the tutorial steps through to where data gets received from the mapset.
- Choose
to display line numbers in the CodeWatch debugger.
Note: You need to have the line numbers displayed to follow the instructions in this tutorial.
- Press
or
F10 several times until you step to the line that shows the following:
244: EXEC CICS RECEIVE MAPSET('OCMCS')
This line indicates that the program receives data from the data from the CICS mapset.
- Press
F10. The debugger steps to line 248. Move the cursor over the text
RC. The tooltip displays
RC=0{fixed binary(31)} which indicates the mapset is successfully retrieved.
- Press
F10 to step to line 256 and move the cursor over the text
NAMEDI. The tooltip displays
WILLIAMS.
- Press
F10 several times until you reach line 313. This line writes the processed input data (WILLIAMS) to CICS temporary storage.
- Press
F10 to step to line 322. Move the cursor over the text
RC on the line. The tooltip displays
RC=0{fixed binary(31)}, which indicates that the program successfully writes the processed input data to a CICS temporary data queue.
- Press
F10 to step to line 330. This line calls the program
STAFF03.
- Press
F10 to step into
STAFF03. The CodeWatch debugger stops and a message appears asking you if you want to debug the PL/I program
STAFF03.
- Click
Yes. CodeWatch reappears and highlights the first line of
STAFF03.
Stepping through the CICS mapset in the STAFF03 Program
- Choose
to display line numbers in the CodeWatch debugger.
Note: You need to have the line numbers displayed to follow the instructions in this tutorial.
- Press
F10 several times to step to line 128, which shows the following.
128: CALL READ_QUEUE;
This line reads a record from the temporary data queue.
- Press
or
F11 to step into the procedure started on line 128. This steps to line 672, which starts a procedure to read the queue that contains in which the processed input data (WILLIAMS) is stored.
- While still stepped to line 672, move the cursor over the text
DDP_STRUCA on line 677. Notice that
LAST NAME doesn't contain
WILLIAMS.
- Press
F10 to step to line 681.
- Move the cursor over
RC and check if the tooltip displays:
RC=0{fixed binary(31)}.
- Move the cursor back over
DDP_STRUCA on line 677. The record now contains
WILLIAMS.
- Press
F10 to continue stepping until you return from the procedure and are on line 144. This line calls the STAFF04 program, which reads the file to determine if
WILLIAMS is present.
- Press
or
F11 to step into
STAFF04.
- Scroll to line 529 and double click to set a breakpoint, then press
to stop program execution at line 529 where you set the breakpoint.
- Press
or
F11 to step into the
READ RECORD procedure.
- If you continue stepping, you will see that as you keep reading records, none of them match on
WILLIAMS.
You can repeat the steps above using a different last name. You can type for example
CH in the last name field and you will see valid records being found in the
PROCESS_DATA procedure.
You can also use the debugger's
Go to line function to skip the code matching on the last name and thus make it "think" it found a matching record and cause it to be displayed. You can access the
Go to line function from the context menu when you right-click the line you want.
Note: For more information on debugging with Java CodeWatch, see
Tutorial: Using Java CodeWatch.