This part of the CICS tutorial shows how to use the Java CodeWatch 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 Focus Rumba. Note that the instructions for setting up a connection or clearing the screen might be different if you are using an emulator other than Micro Focus Rumba.
If you installed Rumba as part of Enterprise Developer, you can also use the embedded Rumba mainframe display from within the IDE.
To open the embedded Rumba mainframe display:
This starts the Mainframe TN3270 Display window inside the IDE. You can reposition or resize the window, if needed.
The display automatically connects to the STAFF enterprise server at the specified TN3270 port. You should see the Signon to CICS screen.
If you are using the standalone Rumba Desktop application, you need to connect it to the server as follows:
The CodeWatch debugger window appears. The debugger displays the STAFF02 program and moves to the initial line of the program code. A Java CodeWatch terminal log window also appears. Both windows might be minimized to the task bar.
For this tutorial, you enter a last name for a staff customer to step through the use of that data in CodeWatch.
The code for the STAFF02 program receives data from the CICS mapset. This part of the tutorial steps through to where data is received from the mapset.
EXEC CICS RECEIVE MAPSET('OCMCS')
This line indicates that the program receives data from the CICS mapset.
IF RC ^= DFHRESP(NORMAL) THEN
Right-click the text RC and choose View contents of 'RC'. RC=0{fixed binary(31)} displays in a message box, indicating the mapset was successfully retrieved. Click Ok to close the message box.
IF NAMEDI = (45) '00'x THEN
Right-click the text NAMEDI and choose View contents of 'NAMEDI'. The text S0934I.NAMEDI = WILLIAMS '{character (45)} displays in a message box. This indicates that the name that you entered was successfully retrieved. Click Ok to close the message box.
EXEC CICS WRITEQ
This line writes the processed input data (WILLIAMS) to CICS temporary storage.
IF RC ^= DFHRESP(NORMAL) THEN
Right-click the text RC and choose View contents of 'RC'. RC=0{fixed binary(31)} displays in a message box, which in this instance indicates that the program has successfully written the processed input data to a CICS temporary data queue. Click Ok to close the message box.
EXEC CICS XCTL PROGRAM ('STAFF03')
This line calls the program STAFF03.
CALL READ_QUEUE;This line calls a PL/I subroutine which then reads the temporary queue.
READ_QUEUE: PROC;
This line starts a procedure to read the queue where the processed input data (WILLIAMS) is stored.
IF RC ^= DFHRESP(NORMAL) THEN
Into (DPP_STRUCA)
Move the cursor back over and right-click the text DDP_STRUCA on that line and choose View contents of 'DDP_STRUCA'. The record in the tooltip now contains WILLIAMS in the DPP_STRUCA.MENU_DATA.NAME.LAST_NAME entry. Click OK to close the message box.
CALL STAFF04(DFHEIPTR, Q_NAME);
This line reads the file to determine if WILLIAMS is present.
CALL PROCESS_DATA();
Press
or
F11 to step into the
PROCESS_DATA procedure
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 behave as though 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.