Mainframe Documents

Wednesday, February 01, 2006

Xpeditor Quick Sample Debugging

Quick Sample Debugging Session
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This chapter demonstrates the basic debugging features of XPEDITER/TSO,
using the sample program TRIMAIN. A quick overview shows you how to do
the following:

* Run and stop the program

* Step through code

* View and modify program variables

* Debug called modules

* Analyze data flow

* Trace logic flow

* Review execution in reverse direction


3.1 Preparing the Programs
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


The source for the sample program TRIMAIN, which calls TRITST and TRIRPT
by use of CALL literal, is contained in the SAMPLIB dataset on the
XPEDITER/TSO product tape. The sample programs can be found in the common
load module, SIR, and file list libraries that have been created and
verified by your site installer. If not found, compile the sample
programs TRITST, TRIRPT, and TRIMAIN with the SIR processor.

Select option 2.1 (XPEDITER/TSO standard environment) from the XPEDITER
Primary Menu. Review the SETUP screens that have been initialized by your
site installer by typing SETUP in the primary command line. Following
this, type TRIMAIN in the Program field and the dataset name that contains
the file list for TRIMAIN in the File Allocation List field. The File
Allocation List should contain the INFILE and OUTFILE, which are defined
in the FD statements of TRIMAIN and must be preallocated when program
TRIMAIN is executed. The input test data can be located in member TRIDATA
of the SAMPLIB dataset. Be sure to direct the program output to the
terminal by specifying TERM for the OUTFILE DD. The file list can be
created by accessing the File Allocation List screen (option 1 on the
XPEDITER Primary Menu or through the use of the ALLOC command).

To start the debugging session, press <ENTER>. XPEDITER/TSO processes
the file list, allocates the necessary datasets, loads the program
TRIMAIN, and displays the COBOL source code. You should be able to see
the message "Before Breakpoint Encountered" with the execution arrow
pointing to the PROCEDURE DIVISION statement. This means that TRIMAIN is
stopped before the start of the program. An example of the source code
display is shown in Figure 3-1.

|----------------------------------------------------------------------------------|
| |
| ------------------------------ XPEDITER/TSO - SOURCE ----------------------------|
| COMMAND ===> SCROLL===> CSR |
| Before Breakpoint Encountered |
| ------ ------------------------------------------------------ Before TRIMAIN --|
| =====> B PROCEDURE DIVISION. |
| 000035 MAIN-PARA. |
| 000036 PERFORM INIT-PARA. |
| 000037 PERFORM ANALYZE-NEXT-REC |
| 000038 UNTIL OUT-OF-RECS = 'Y'. |
| 000039 PERFORM ENDING-PARA. |
| 000040 A GOBACK. |
| 000041 INIT-PARA. |
| 000042 MOVE ZERO TO N-CNTR (1) N-CNTR (2) N-CNTR (3) N-CNTR (4). |
| 000043 OPEN INPUT INFILE. |
| 000044 MOVE 'N' TO OUT-OF-RECS. |
| 000045 ANALYZE-NEXT-REC. |
| 000046 READ INFILE INTO WORK-REC |
| 000047 AT END |
| 000048 MOVE 'Y' TO OUT-OF-RECS. |
| 000049 IF OUT-OF-RECS = 'N' |
| 000050 MOVE ZERO TO TRIANGLE-TYPE |
| 000051 CALL 'TRITST' USING WORK-REC TRIANGLE-TYPE |
| 000052 SET TX TO TRIANGLE-TYPE |
| 000053 ADD 1 TO N-CNTR (TX). |
| |
|----------------------------------------------------------------------------------|

Figure 3-1. Debugging Screen Showing TRIMAIN Program

To access HELP, press the <PF1> key. To terminate the debugging session
and return to the Standard screen, press the <PF4> (EXIT) key. If you
need to reload the program and test again from the beginning, type the
following command in the primary command line:

RETEST

The RETEST command resets all the breakpoints and data displays.


RETEST is not valid in Dialog, BTS, or IMS environments, or with DB2
databases.

3.2 Setting Breakpoints
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


You can control program execution by setting breakpoints and running the
program. A breakpoint is a certain location in your program where you
want program execution to stop so you can inspect the data the program is
processing and check the logic to make certain it is correct.

A simple way to set a breakpoint is to enter it from the line command
area. Move the cursor to the compiler-generated statement number 43 at
the OPEN verb, then type over the statement number with the B(efore) line
command, as shown in Part A of Figure 3-2, and press <ENTER>. A "B"
appears in column 9 on statement 43, as seen in Part B, indicating that a
BEFORE breakpoint has been set. This breakpoint causes program execution
to pause before executing the OPEN statement.


|------------------------------------------------------------------------------|
| Part A: Entering B Line Command on Statement 43 |
|------------------------------------------------------------------------------|
| =====> B PROCEDURE DIVISION. |
| 000035 MAIN-PARA. |
| 000036 PERFORM INIT-PARA. |
| 000037 PERFORM ANALYZE-NEXT-REC |
| 000038 UNTIL OUT-OF-RECS = 'Y'. |
| 000039 PERFORM ENDING-PARA. |
| 000040 A GOBACK. |
| 000041 INIT-PARA. |
| 000042 MOVE ZERO TO N-CNTR (1) N-CNTR (2) N-CNTR (3) N-CNTR (4). |
| B 043 OPEN INPUT INFILE. |
| 000044 MOVE 'N' TO OUT-OF-RECS. |
|------------------------------------------------------------------------------|
| Part B: BEFORE Breakpoint Displayed for Statement 43 |
|------------------------------------------------------------------------------|
| =====> B PROCEDURE DIVISION. |
| 000035 MAIN-PARA. |
| 000036 PERFORM INIT-PARA. |
| 000037 PERFORM ANALYZE-NEXT-REC |
| 000038 UNTIL OUT-OF-RECS = 'Y'. |
| 000039 PERFORM ENDING-PARA. |
| 000040 A GOBACK. |
| 000041 INIT-PARA. |
| 000042 MOVE ZERO TO N-CNTR (1) N-CNTR (2) N-CNTR (3) N-CNTR (4). |
| 000043 B OPEN INPUT INFILE. |
| 000044 MOVE 'N' TO OUT-OF-RECS. |
|------------------------------------------------------------------------------|


Figure 3-2. Entering a BEFORE Breakpoint on Line 43

Press <PF12> (GO) to execute TRIMAIN until the breakpoint is reached. The
program stops at statement 43, where the execution arrow is pointing. The
execution status field on the fourth line also shows that execution is at
"Before TRIMAIN.43," as shown in Figure 3-3.

|----------------------------------------------------------------------------------|
| |
| ------------------------------ XPEDITER/TSO - SOURCE ----------------------------|
| COMMAND ===> SCROLL===> CSR |
| Before Breakpoint Encountered |
| ------ --------------------------------------------------- Before TRIMAIN.43 --|
| 000034 B PROCEDURE DIVISION. |
| 000035 MAIN-PARA. |
| 000036 PERFORM INIT-PARA. |
| 000037 PERFORM ANALYZE-NEXT-REC |
| 000038 UNTIL OUT-OF-RECS = 'Y'. |
| 000039 PERFORM ENDING-PARA. |
| 000040 A GOBACK. |
| 000041 INIT-PARA. |
| 000042 MOVE ZERO TO N-CNTR (1) N-CNTR (2) N-CNTR (3) N-CNTR (4). |
| =====> B OPEN INPUT INFILE. |
| 000044 MOVE 'N' TO OUT-OF-RECS. |
| 000045 ANALYZE-NEXT-REC. |
| 000046 READ INFILE INTO WORK-REC |
| 000047 AT END |
| 000048 MOVE 'Y' TO OUT-OF-RECS. |
| 000049 IF OUT-OF-RECS = 'N' |
| 000050 MOVE ZERO TO TRIANGLE-TYPE |
| 000051 CALL 'TRITST' USING WORK-REC TRIANGLE-TYPE |
| 000052 SET TX TO TRIANGLE-TYPE |
| 000053 ADD 1 TO N-CNTR (TX). |
| 00054 ENDING-PARA. |
| |
|----------------------------------------------------------------------------------|

Figure 3-3. BEFORE Breakpoint at Statement 43

Press <PF9> (GO 1) to execute statements one-by-one. The program stops at
statement 44 after the input file is opened and before the OUT-OF-RECS
switch is set to "N." Type the SHOW FILE command in the primary command
line.

The DD names and DCB parameters that you generally specify in the JCL
statements are listed, together with the file I/O status, as shown in
Figure 3-4.

|----------------------------------------------------------------------------------|
| |
| ------------------------------- XPEDITER/TSO - SHOW -----------------------------|
| COMMAND ===> SCROLL===> CSR |
| PROGRAM: TRIMAIN MODULE: TRIMAIN COMP DATE: 07/29/92 COMP TIME: 14.41.59 |
| ------------------------------------------------------------ Before TRIMAIN.44 --|
| ******************************* TOP OF DATA ********************************** |
| ** FILE ATTRIBUTES FOR APPLICATION MODULE TRIMAIN *** |
| DSORG RECFM BLKSI LRECL |
| NON-VSAM FILE FOR DDNAME INFILE OPEN DCB = PS FB 23440 80 |
| DSN=AXPTSO.QA.TSODATA.DATA JFCB= PO FB 23440 80 |
| MBR=TRIDATA |
| DATA SET ALLOCATED ON VOLUME AXP001 DSCB= PO FB 23440 80 |
| ORGANIZATION = SEQUENTIAL ACCESS MODE = SEQUENTIAL RECFM = FB |
| OPEN VERB OPTION = INPUT LAST I/O STATEMENT = OPEN STATUS = 00 |
| |
| ** FILE ATTRIBUTES FOR APPLICATION MODULE TRIRPT *** |
| DSORG RECFM BLKSI LRECL |
| NON-VSAM FILE FOR DDNAME OUTFILE CLOSED DCB = PS -- 0 80 |
| DSN=*TERMINAL* JFCB= PS -- 0 0 |
| ORGANIZATION = SEQUENTIAL ACCESS MODE = SEQUENTIAL RECFM = FB |
| |
| ** END OF FILE ATTRIBUTE DISPLAY *** |
| ****************************** BOTTOM OF DATA ******************************** |
| |

Figure 3-4. File Attributes Displayed by the SHOW FILE Command

Press <PF3> (END) to return to the Source screen.

There are several variations of the breakpoint commands. A B line command
sets a BEFORE breakpoint. An A line command sets an AFTER breakpoint.
You may want to place an AFTER breakpoint on a conditional statement since
XPEDITER/TSO tells you what the next logical statement will be when the
breakpoint is encountered.

To remove breakpoints, enter the D(elete) line command on a line that has
a breakpoint and press <ENTER>.

3.3 Displaying Data Contents
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


In the TRIMAIN program, move the cursor to statement 42, where a table
would have been initialized with zeros, type over the statement number
with the P (PEEK) line command, and press <ENTER>. The screen
automatically scrolls up to the DATA DIVISION statement and displays the
data content of N-CNTR, as shown in Figure 3-5.

|----------------------------------------------------------------------------------|
| |
| ------------------------------ XPEDITER/TSO - SOURCE ----------------------------|
| COMMAND ===> SCROLL===> CSR |
| PROGRAM: TRIMAIN MODULE: TRIMAIN COMP DATE: 07/29/92 COMP TIME: 14.41.59 |
| ------ --------------------------------------------------- Before TRIMAIN.44 --|
| > 1 OCCURRENCE |
| 000027 10 N-CNTR > 0000 DECIMAL |
| 000028 01 OUT-OF-RECS PIC X. |
| 000029 01 TRIANGLE-TYPE PIC 9. |
| 000030 01 WORK-REC. |
| 000031 05 SIDE-A PIC 9(01). |
| 000032 05 SIDE-B PIC 9(01). |
| 000033 05 SIDE-C PIC 9(01). |
| 000034 B PROCEDURE DIVISION. |
| 000035 MAIN-PARA. |
| 000036 PERFORM INIT-PARA. |
| 000037 PERFORM ANALYZE-NEXT-REC |
| 000038 UNTIL OUT-OF-RECS = 'Y'. |
| 000039 PERFORM ENDING-PARA. |
| 000040 A GOBACK. |
| 000041 INIT-PARA. |
| 000042 MOVE ZERO TO N-CNTR (1) N-CNTR (2) N-CNTR (3) N-CNTR (4). |
| 000043 B OPEN INPUT INFILE. |
| =====> MOVE 'N' TO OUT-OF-RECS. |
| 000045 ANALYZE-NEXT-REC. |
| |
|----------------------------------------------------------------------------------|

Figure 3-5. Displaying the Data Content of N-CNTR

Tab down to the arrow that shows the occurrence number and type over the 1
with a 2 and press <ENTER>. Continue typing over the occurrence number,
each time adding 1 to the previous number. Eventually, XPEDITER/TSO
displays the warning shown in Figure 3-6, indicating that the index
boundary has been reached.

|----------------------------------------------------------------------------------|
| |
| ------------------------------ XPEDITER/TSO - SOURCE ----------------------------|
| COMMAND ===> SCROLL===> CSR |
| NUMBER EXCEEDS MAXIMUM OCCURRENCES FOR ITEM |
| ------ --------------------------------------------------- Before TRIMAIN.44 --|
| > 5 OCCURRENCE |
| 000027 10 N-CNTR > ???? INVALID DECIMAL |
| 000028 01 OUT-OF-RECS PIC X. |
| 000029 01 TRIANGLE-TYPE PIC 9. |
| 000030 01 WORK-REC. |
| 000031 05 SIDE-A PIC 9(01). |
| 000032 05 SIDE-B PIC 9(01). |
| 000033 05 SIDE-C PIC 9(01). |
| 000034 B PROCEDURE DIVISION. |
| 000035 MAIN-PARA. |
| 000036 PERFORM INIT-PARA. |
| 000037 PERFORM ANALYZE-NEXT-REC |
| 000038 UNTIL OUT-OF-RECS = 'Y'. |
| 000039 PERFORM ENDING-PARA. |
| 000040 A GOBACK. |
| 000041 INIT-PARA. |
| 000042 MOVE ZERO TO N-CNTR (1) N-CNTR (2) N-CNTR (3) N-CNTR (4). |
| 000043 B OPEN INPUT INFILE. |
| =====> MOVE 'N' TO OUT-OF-RECS. |
| 000045 ANALYZE-NEXT-REC. |
| |
|----------------------------------------------------------------------------------|

Figure 3-6. Message Indicating That the Index Boundary Has Been Reached

Press <PF6> (LOCATE *) to scroll down to where the execution arrow is.
See Figure 3-7.

|----------------------------------------------------------------------------------|
| |
| ------------------------------ XPEDITER/TSO - SOURCE ----------------------------|
| COMMAND ===> SCROLL===> CSR |
| PROGRAM: TRIMAIN MODULE: TRIMAIN COMP DATE: 07/29/92 COMP TIME: 14.41.59 |
| ------ --------------------------------------------------- Before TRIMAIN.44 --|
| =====> MOVE 'N' TO OUT-OF-RECS. |
| 000045 ANALYZE-NEXT-REC. |
| 000046 READ INFILE INTO WORK-REC |
| 000047 AT END |
| 000048 MOVE 'Y' TO OUT-OF-RECS. |
| 000049 IF OUT-OF-RECS = 'N' |
| 000050 MOVE ZERO TO TRIANGLE-TYPE |
| 000051 CALL 'TRITST' USING WORK-REC TRIANGLE-TYPE |
| 000052 SET TX TO TRIANGLE-TYPE |
| 000053 ADD 1 TO N-CNTR (TX). |
| 000054 ENDING-PARA. |
| 000055 CLOSE INFILE. |
| 000056 CALL 'TRIRPT' USING NAME-N-CNTR-TABLE. |
| ****** *********************** BOTTOM OF MODULE *************************** |
| |

Figure 3-7. TRIMAIN After Entering LOCATE * Command

Place an A line command on statement 46, setting an AFTER breakpoint at
the READ statement. Next, type the K2 line command on statement 46 to
open a Keep window at the top of the screen and display the contents of
Working Storage item WORK-REC (the second variable identified on line 46).
The display is shown in Figure 3-8.

|----------------------------------------------------------------------------------|
| |
| ------------------------------ XPEDITER/TSO - SOURCE ----------------------------|
| COMMAND ===> SCROLL===> CSR |
| PROGRAM: TRIMAIN MODULE: TRIMAIN COMP DATE: 07/29/92 COMP TIME: 14.41.59 |
| --- |
| 000030 01 WORK-REC > ... |
| ------ --------------------------------------------------- Before TRIMAIN.44 --|
| =====> MOVE 'N' TO OUT-OF-RECS. |
| 000045 ANALYZE-NEXT-REC. |
| 000046 A READ INFILE INTO WORK-REC |
| 000047 AT END |
| 000048 MOVE 'Y' TO OUT-OF-RECS. |
| 000049 IF OUT-OF-RECS = 'N' |
| 000050 MOVE ZERO TO TRIANGLE-TYPE |
| 000051 CALL 'TRITST' USING WORK-REC TRIANGLE-TYPE |
| 000052 SET TX TO TRIANGLE-TYPE |
| 000053 ADD 1 TO N-CNTR (TX). |
| 000054 ENDING-PARA. |
| 000055 CLOSE INFILE. |
| 000056 CALL 'TRIRPT' USING NAME-N-CNTR-TABLE. |
| ****** ************************ BOTTOM OF MODULE ***************************** |
| |

Figure 3-8. Opening Up a Keep Window for the Second Variable (WORK-REC)
on Line 46

Press <PF12> (GO) to execute TRIMAIN. As shown in Figure 3-9, you can
see that record '345' was read when the READ verb was executed.

|----------------------------------------------------------------------------------|
| |
| ------------------------------ XPEDITER/TSO - SOURCE ----------------------------|
| COMMAND ===> SCROLL===> CSR |
| Next logical instruction is TRIMAIN.49 |
| --- |
| 000030 01 WORK-REC > 345 |
| ------ ---------------------------------------------------- After TRIMAIN.46 --|
| 000044 MOVE 'N' TO OUT-OF-RECS. |
| 000045 ANALYZE-NEXT-REC. |
| ====>> A READ INFILE INTO WORK-REC |
| 000047 AT END |
| 000048 MOVE 'Y' TO OUT-OF-RECS. |
| 000049 IF OUT-OF-RECS = 'N' |
| 000050 MOVE ZERO TO TRIANGLE-TYPE |
| 000051 CALL 'TRITST' USING WORK-REC TRIANGLE-TYPE |
| 000052 SET TX TO TRIANGLE-TYPE |
| 000053 ADD 1 TO N-CNTR (TX). |
| 000054 ENDING-PARA. |
| 000055 CLOSE INFILE. |
| 000056 CALL 'TRIRPT' USING NAME-N-CNTR-TABLE. |
| ***** ************************** BOTTOM OF MODULE ***************************** |
| |

Figure 3-9. Displaying a Variable in a Keep Window

Press <PF12> (GO) again. Paragraph ANALYZE-NEXT-REC is performed until
EOF, and the next record '789' is read in the second time through the
loop. WORK-REC is updated to reflect the change. As you execute your
program, XPEDITER/TSO updates the Keep window to reflect the current
values. You can also type over the displayed fields and modify the data
values as if the program had executed the MOVE statement.

3.4 Debugging Subroutines
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Statement 51 shows that the program TRIMAIN calls TRITST and passes
parameters WORK-REC and TRIANGLE-TYPE. In order to examine how TRITST is
processing these parameters, you might want to set a breakpoint at the
beginning of TRITST to gain control of the execution. Therefore, type the
following command in the primary command line:

BEFORE TRITST.

The period (.) after the program name indicates that a module-level
breakpoint is requested. Press <PF12> (GO) to execute the program.
XPEDITER/TSO pauses execution at the PROCEDURE DIVISION USING statement.
Now, type the following command in the primary command line.

PEEK LINKAGE

The Linkage Section shows that the correct values, '789' for TST-REC and
'0' for TYPE-OF-TRIANGLE were passed from the driver TRIMAIN.

|----------------------------------------------------------------------------------|
| |
| ------------------------------ XPEDITER/TSO - SOURCE ----------------------------|
| COMMAND ===> SCROLL===> CSR |
| PROGRAM: TRITST MODULE: TRITST COMP DATE: 07/29/92 COMP TIME: 14.41.59 |
| ------ ------------------------------------------------------- Before TRITST --|
| --- |
| 000010 01 TST-REC > 789 |
| 000011 05 A PIC 9. |
| 000012 05 B PIC 9. |
| 000013 05 C PIC 9. |
| 000014 01 TYPE-OF-TRIANGLE > 0 DECIMAL |
| =====> B PROCEDURE DIVISION USING TST-REC |
| 000016 TYPE-OF-TRIANGLE. |
| 000017 VALIDATE-TRIANGLE. |
| 000018 ADD A B GIVING A-N-B. |
| 000019 ADD A C GIVING A-N-C. |
| 000020 ADD B C GIVING B-N-C. |
| 000021 IF (B-N-C NOT > A) OR (A-N-C NOT > B) OR (A-N-B NOT > C) |
| 000022 MOVE 4 TO TYPE-OF-TRIANGLE. |
| 000023 DETERMINE-TYPE. |
| 000024 IF TYPE-OF-TRIANGLE = 4 |
| 000025 NEXT SENTENCE |
| 000026 ELSE |
| 000027 IF (A = B) AND (B = C) |
| 000028 MOVE 1 TO TYPE-OF-TRIANGLE |
| |
|----------------------------------------------------------------------------------|

Figure 3-10. Displaying LINKAGE SECTION in the Called Module TRITST

3.5 Analyzing Data Flow
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


To better understand how the parameters are processed in the subroutine,
XPEDITER/TSO allows you to cross-reference data and to analyze the data
flow in your program. The 01 level for TST-REC has three 05 levels: A,
B, and C. Essentially, the elementary items are the aliases of a group
item. Type the following command in the primary command line:

FIND TST-REC ALIAS

XPEDITER/TSO highlights all the statements that reference (DEFine,
MODify, USE) TST-REC and its aliases. The message shown in Figure 3-11 is
issued, which states how many data definitions were found.

|----------------------------------------------------------------------------------|
| |
| ------------------------------ XPEDITER/TSO - SOURCE ----------------------------|
| COMMAND ===> SCROLL===> CSR |
| 24 DATA REFS: 4 DEFS, 20 USES FOUND FOR TST-REC |
| ------ ------------------------------------------------------- Before TRITST --|
| --- |
| 000010 01 TST-REC > 789 |
| 000011 05 A PIC 9. DEF |
| 000012 05 B PIC 9. DEF |
| 000013 05 C PIC 9. DEF |
| 000014 01 TYPE-OF-TRIANGLE > 0 DECIMAL |
| =====> B PROCEDURE DIVISION USING TST-REC USE |
| 000016 TYPE-OF-TRIANGLE. |
| 000017 VALIDATE-TRIANGLE. |
| 000018 ADD A B GIVING A-N-B. 2 USE |
| 000019 ADD A C GIVING A-N-C. 2 USE |
| 000020 ADD B C GIVING B-N-C. 2 USE |
| 000021 IF (B-N-C NOT > A) OR (A-N-C NOT > B) OR (A-N-B NOT > C) 3 USE |
| 000022 MOVE 4 TO TYPE-OF-TRIANGLE. |
| 000023 DETERMINE-TYPE. |
| 000024 IF TYPE-OF-TRIANGLE = 4 |
| 000025 NEXT SENTENCE |
| 000026 ELSE |
| 000027 IF (A = B) AND (B = C) 4 USE |
| 000028 MOVE 1 TO TYPE-OF-TRIANGLE |
| |
|----------------------------------------------------------------------------------|

Figure 3-11. Finding Statements That Reference TST-REC

The analysis concludes that parameter TST-REC is USEd, but never MODified
in the subroutine. What about parameter TYPE-OF-TRIANGLE? Type the
following command in the primary command line:

FIND TYPE-OF-TRIANGLE MOD

The message "4 DATA MODS FOUND FOR TYPE-OF-TRIANGLE" is displayed in the
message line, as shown in Figure 3-12, which means that the parameter is
MODified four times.

|----------------------------------------------------------------------------------|
| |
| ------------------------------ XPEDITER/TSO - SOURCE ----------------------------|
| COMMAND ===> SCROLL===> CSR |
| 4 DATA MODS FOUND FOR TYPE-OF-TRIANGLE |
| ------ ------------------------------------------------------- Before TRITST --|
| --- |
| 000010 01 TST-REC > 345 |
| 000011 05 A PIC 9. |
| 000012 05 B PIC 9. |
| 000013 05 C PIC 9. |
| 000014 01 TYPE-OF-TRIANGLE > 0 DECIMAL |
| =====> B PROCEDURE DIVISION USING TST-REC |
| 000016 TYPE-OF-TRIANGLE. |
| 000017 VALIDATE-TRIANGLE. |
| 000018 ADD A B GIVING A-N-B. |
| 000019 ADD A C GIVING A-N-C. |
| 000020 ADD B C GIVING B-N-C. |
| 000021 IF (B-N-C NOT > A) OR (A-N-C NOT > B) OR (A-N-B NOT > C) |
| 000022 MOVE 4 TO TYPE-OF-TRIANGLE. MOD |
| 000023 DETERMINE-TYPE. |
| 000024 IF TYPE-OF-TRIANGLE = 4 |
| 000025 NEXT SENTENCE |
| 000026 ELSE |
| 000027 IF (A = B) AND (B = C) |
| 000028 MOVE 1 TO TYPE-OF-TRIANGLE MOD |
| |
|----------------------------------------------------------------------------------|

Figure 3-12. Result of Entering FIND TYPE-OF-TRIANGLE MOD Command

The FIND command under XPEDITER/TSO is sensitive to COBOL-structure
keywords as well as data reference keywords. For instance, you can use
the FIND command to search conditional statements or I/O statements. The
highlighting effect helps you capture the program logic and understand
what the program does.

3.6 Tracing Logic Flow
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Subroutine TRITST evaluates the type of triangle by using TST-REC and
updates TYPE-OF-TRIANGLE. Paragraph DETERMINE-TYPE (statement 23) has a
nested IF structure. XPEDITER/TSO can automatically trace the logic flow
to show which path was chosen. Type the following command in the primary
command line:

TRACE ALL STATEMENTS;GO

Tracing pauses when the AFTER breakpoint is reached when control is
returned to the calling module TRIMAIN, as shown in Figure 3-13.

|----------------------------------------------------------------------------------|
| |
| ------------------------------ XPEDITER/TSO - SOURCE ----------------------------|
| COMMAND ===> SCROLL===> CSR |
| Next logical instruction is TRIMAIN.49 |
| --- |
| 000030 01 WORK-REC > 563 |
| ------ ---------------------------------------------------- After TRIMAIN.46 --|
| 000044 MOVE 'N' TO OUT-OF-RECS. |
| 000045 ANALYZE-NEXT-REC. |
| ====>> A READ INFILE INTO WORK-REC |
| 000047 AT END |
| 000048 MOVE 'Y' TO OUT-OF-RECS. |
| 000049 IF OUT-OF-RECS = 'N' |
| 000050 MOVE ZERO TO TRIANGLE-TYPE |
| 000051 CALL 'TRITST' USING WORK-REC TRIANGLE-TYPE |
| 000052 SET TX TO TRIANGLE-TYPE |
| 000053 ADD 1 TO N-CNTR (TX). |
| 000054 ENDING-PARA. |
| 000055 CLOSE INFILE. |
| 000056 CALL 'TRIRPT' USING NAME-N-CNTR-TABLE. |
| ****** *********************** BOTTOM OF MODULE ***************************** |
| |
| |
| |
| |
| |
|----------------------------------------------------------------------------------|

Figure 3-13. Tracing is Paused for the AFTER Breakpoint in the Calling
Module TRIMAIN

Press <PF12> (GO) to return to TRITST again. If execution is too fast
for you to follow, type the following command in the primary command line
to control the tracing speed:

SET DELAY 1;GO

Otherwise, press <PF12> (GO) to trace through TRITST.

3.7 Review Mode
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Type the following command in the primary command line:

MONITOR ALL

Press <PF12> (GO) to start execution, followed by another <PF12> (GO) to
continue execution. When the AFTER breakpoint is reached in TRIMAIN, type
the following command in the primary command line to change the direction
of execution processing:

REVERSE

The execution status line shows that XPEDITER/TSO is reviewing in the
reverse direction. See Figure 3-14.

|----------------------------------------------------------------------------------|
| |
| ------------------------------ XPEDITER/TSO - SOURCE ----------------------------|
| COMMAND ===> SCROLL===> CSR |
| Next logical instruction is RESUME EXECUTION |
| --- |
| 000030 01 WORK-REC > 345 |
| ------ -------------------------------------------Reverse - After TRIMAIN.46 --|
| 000044 MOVE 'N' TO OUT-OF-RECS. |
| 000045 ANALYZE-NEXT-REC. |
| ====>> A READ INFILE INTO WORK-REC |
| 000047 AT END |
| 000048 MOVE 'Y' TO OUT-OF-RECS. |
| 000049 IF OUT-OF-RECS = 'N' |
| 000050 MOVE ZERO TO TRIANGLE-TYPE |
| 000051 CALL 'TRITST' USING WORK-REC TRIANGLE-TYPE |
| 000052 SET TX TO TRIANGLE-TYPE |
| 000053 ADD 1 TO N-CNTR (TX). |
| 000054 ENDING-PARA. |
| 000055 CLOSE INFILE. |
| 000056 CALL 'TRIRPT' USING NAME-N-CNTR-TABLE. |
| ****** *********************** BOTTOM OF MODULE ****************************** |
| |
| |
| |
| |
| |
|----------------------------------------------------------------------------------|

Figure 3-14. Review Mode Execution

Now step through each statement backwards by pressing <PF9> (GO 1)
several times. Data values in the Keep window reshow the original state
as the MOVE, ADD, and READ verbs are being "undone."

You can remove the Keep window by typing the following command in the
primary command line:

DELETE KEEP

If you want to remove a certain data item from the Keep window, enter the
D line command on the appropriate line. Press <PF4> (EXIT) to exit the
debugging session and to return to the Standard screen.

Xpeditor Screen

Xpeditor - Screen Format
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


XPEDITER/TSO uses ISPF/PDF-like screens. Figure 2-1 shows the Source
screen.

|----------------------------------------------------------------------------------|
| |
| ------------------------------ XPEDITER/TSO - SOURCE ----------------------------|
| COMMAND ===> SCROLL===> CSR |
| PROGRAM: TRIMAIN MODULE: TRIMAIN COMP DATE: 07/29/92 COMP TIME: 14.41.59 |
| ------ ------------------------------------------------------ Before TRIMAIN --|
| =====> B PROCEDURE DIVISION. |
| 000035 MAIN-PARA. |
| 000036 PERFORM INIT-PARA. |
| 000037 PERFORM ANALYZE-NEXT-REC |
| 000038 UNTIL OUT-OF-RECS = 'Y'. |
| 000039 PERFORM ENDING-PARA. |
| 000040 A GOBACK. |
| 000041 INIT-PARA. |
| 000042 MOVE ZERO TO N-CNTR (1) N-CNTR (2) N-CNTR (3) N-CNTR (4). |
| 000043 OPEN INPUT INFILE. |
| 000044 MOVE 'N' TO OUT-OF-RECS. |
| 000045 ANALYZE-NEXT-REC. |
| 000046 READ INFILE INTO WORK-REC |
| 000047 AT END |
| 000048 MOVE 'Y' TO OUT-OF-RECS. |
| 000049 IF OUT-OF-RECS = 'N' |
| 000050 MOVE ZERO TO TRIANGLE-TYPE |
| 000051 CALL 'TRITST' USING WORK-REC TRIANGLE-TYPE |
| 000052 SET TX TO TRIANGLE-TYPE |
| 000053 ADD 1 TO N-CNTR (TX). |
| |
|----------------------------------------------------------------------------------|

Figure 2-1. XPEDITER/TSO Source Display Screen

The first four lines of the XPEDITER/TSO screens are formatted as follows:

|------------------------------------------------------------------------|
| Title |
|---------------------------------------------------------|--------------|
| Command Area | Scroll |
| | Amount |
|-----------------|------------------|-----------------|--|--------------|
| Program | Module | Compile Date | Compile Time |
|-----------------|------------------|-----------------|-----------------|
| Execution Status |
|------------------------------------------------------------------------|



These areas are described as:

Title (line 1)--Identifies the screen name: SOURCE, LOG, SHOW,
MEMORY, etc.

Command Area (line 2)--Primary command line, which can be increased to
three lines using the SET CMDSIZE command.

Scroll Amount (line 2)--Indicates the current scroll amount. You can
type over the current value with one of the following
values:

1 to 9999 Specifies scrolling by the number of lines or
columns.

CSR or C Specifies scrolling based on the current
position of the cursor.

DATA or D Specifies scrolling by one line or column less
than PAGE.

HALF or H Specifies scrolling by a half page.

MAX or M Specifies scrolling to the top, bottom, left
margin, or right margin.

PAGE or P Specifies scrolling by one page.

Program (line 3)--Identifies the source program currently
displayed. This is an unprotected field and can be typed
over with another program name.

Module (line 3)--Displays the load module name.

Compile Date (line 3)--Displays the compile date.

Compile Time (line 3)--Displays the compile time.

Message Area (line 3)--Displays short or informational messages. When a
message is issued, it overlays the program information in
line 3. Press <ENTER> to flush the message and display the
Program field. Additional information can be accessed by
pressing <PF1> (HELP).

Execution Status (line 4)--Identifies the current execution point in your
program. In an Assembler program, an arrow is displayed at
the end of this line to indicate that the source can be
scrolled to the left and/or right.

When a Keep window is present, the execution status line is
displayed at the bottom of the Keep window.


2.1.1 Source Area
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


The source area begins on line 5 and displays 68 to 70 bytes of text on
the screen at a time. In Assembler, the screen can be scrolled RIGHT
and/or LEFT to allow access to the full source.

The AFTER, BEFORE, KEEP, and SKIP indicators are displayed on the left
side of the screen in column 9. A 7-digit counter set by the COUNT
command is displayed on the right side beginning at column 74.

2.2 PF Keys
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


The default settings for the 24 PF keys are listed below. These values
are valid during the XPEDITER/TSO session. ISPF PF keys are not affected.
The ISPF KEYS command or the SET PFn command can be used to override the
default values.

|-----------|--------------|---------------------------------------------|
| PF Key | Default | Description of Function |
| | Setting | |
|-----------|--------------|---------------------------------------------|
| PF1/PF13 | HELP | Further elaborates an XPEDITER/TSO message |
| | | and invokes the context-sensitive tutorial |
| | | facility. |
|-----------|--------------|---------------------------------------------|
| PF2 | PEEK CSR | Displays the contents of the data name |
| | | defined by the current cursor position. |
| | | The cursor must be in the source window |
| | | under a valid data name. |
|-----------|--------------|---------------------------------------------|
| PF14 | FIND CSR | Displays the data name located under the |
| | | cursor position. |
|-----------|--------------|---------------------------------------------|
| PF3/PF15 | END | Returns you to the previous menu if you are |
| | | in the LOG, HELP, BROWSE, or SHOW |
| | | functions. |
|-----------|--------------|---------------------------------------------|
| PF4/PF16 | EXIT | Ends the current XPEDITER/TSO session. |
|-----------|--------------|---------------------------------------------|
| PF5 | FIND | Repeats the action of the previous FIND |
| | | command. |
|-----------|--------------|---------------------------------------------|
| PF17 | FIND IND | Scrolls the source display to successive |
| | | levels of indirect references related to a |
| | | previously entered FIND INDIRECT command. |
|-----------|--------------|---------------------------------------------|
| PF6/PF18 | LOCATE * | Scrolls the source display to the current |
| | | location where execution has been |
| | | suspended. |
|-----------|--------------|---------------------------------------------|
| PF7/PF19 | UP | Scrolls the source display up, or toward |
| | | the top of the file. |
|-----------|--------------|---------------------------------------------|
| PF8/PF20 | DOWN | Scrolls the source display down, or toward |
| | | the bottom of the file. |
|-----------|--------------|---------------------------------------------|
| PF9/PF21 | GO 1 | Executes the next logical instruction in |
| | | your program, then pauses. |
|-----------|--------------|---------------------------------------------|
| PF10/PF22 | LEFT | Scrolls the display to the left. |
|-----------|--------------|---------------------------------------------|
| PF11/PF23 | RIGHT | Scrolls the display to the right. |
|-----------|--------------|---------------------------------------------|
| PF12/PF24 | GO | Starts or resumes execution of your |
| | | program. |
|-----------|--------------|---------------------------------------------|
Table 2-1. Program Function (PF) Keys

2.3 Command Processing
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


In interactive mode, the results of command execution are immediately
visible on the source display. Additional commands can also be entered
dynamically.

XPEDITER/TSO commands can be entered in three ways:

1. Enter the command in the primary command area and press <ENTER>.
Command stacking--delimited by a semicolon (;), the default--is
allowed except in the DIALOG environment.

The primary command area can be extended up to three lines by using
the SET CMDSIZE command. The previous primary command can be recalled
by entering a question mark (?).

2. Press the PF key that was assigned to the desired command. See
Table 2-1 in topic 2.2 for a list of the PF key assignments.

3. Type over the 6-digit compiler-generated statement number with a valid
line command and press <ENTER>.

XPEDITER/TSO records the line command in the log in the same manner as
the primary command.

By default, commands entered in lowercase are converted to uppercase. To
override the default, use the SET CAPS OFF command. Also, to display
lowercase data, use the SET LOWCASE ASIS command.

2.4 HELP and Tutorial (Option T) Information
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


The HELP function provides you with access to general or specific
information regarding an XPEDITER/TSO command, panel, or message. Use the
END command to terminate the HELP function.

The ISPF HELP function is supported from all menus within the XPEDITER/TSO
ISPF Interface. To obtain information on any menu or message, press the
HELP PF key, <PF1>, or enter HELP on the command line.

Once you are in the Tutorial, you can continue to press <ENTER> to see
subsequent pages of the HELP text. The UP, BACK, NEXT, INDEX, and HELP
subcommands of the ISPF HELP function can be used to quickly locate a
particular topic.

You can also select option T to gain access to the Tutorial directly from
the Primary Menu.

2.5 General Product Information (Option B)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


The Bulletin screen contains updated information relevant to the new
release. A similar version of this information is contained in the
"Changes for This Release" in topic 1.1.