IBM AS/400 manual Example of Setting a Watch Condition

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 217
Image 217
Example of Setting a Watch Condition

Example of Setting a Watch Condition

Example of Setting a Watch Condition

In this example, you watchSALARYa variablein programMYLIB/PAYROLL. To set the watch condition, type:

WATCH SALARY

on a debug line, accepting the default value for the watch-length.

If the value of theSALARYvariablechanges subsequently, the application stops a

theDisplay Module Sourcedisplay is shown, as illustrated in Figure 91.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Display Module Source

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Program:

PAYROL

Library:

MYLIB

Module:

PAYROLL

 

 

 

52

C

 

 

eval

cnt = 1

 

 

 

 

 

 

53

C

 

 

dow

(cnt < EMPMAX)

 

 

 

 

 

54

C

 

 

eval

Pay_exmpt(cnt) = eflag(cnt)

 

 

 

55

C

 

 

eval

cnt = cnt + 1

 

 

 

 

 

 

56

C

 

 

enddo

 

 

 

 

 

 

 

57

C

 

 

 

 

 

 

 

 

 

 

58

C

 

 

eval

index = 1

 

 

 

 

 

 

59

C

 

 

dow

index <= cnt

 

 

 

 

 

 

60

C

 

 

if

Pay_exmpt(index) = 1

 

 

 

 

 

61

C

 

 

eval

SALARY = 40 * Pay_wage(index)

 

 

 

62

C

 

 

eval

numexmpt = numexmpt + 1

 

 

 

63

C

 

 

else

 

 

 

 

 

 

 

64

C

 

 

eval

SALARY = Pay_hours(index)*Pay_wage(index)

 

 

 

65

C

 

 

endif

 

 

 

 

 

 

 

66

C

 

 

eval

index = index + 1

 

 

 

 

 

67

C

 

 

enddo

 

 

More...

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Debug . . .

 

_________________________________________________________________

 

 

 

 

_______________________________________________________________________________

 

 

 

 

 

F3=End program F6=Add/Clear breakpoint F10=Step

F11=Display variable

 

 

 

 

F12=Resume

 

 

F17=Watch variable

F18=Work with watch

F24=More keys

 

 

 

ˆ Watch number

1 at line 65, variable: SALARY

 

˜

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure

91.

 

Example of Message Stating WATCH was Successfully Set

¹The line number of the statement where the change to the watch detected is highlighted. This is typically thefollowingfirstheexecutable

statement that changed the variable.

¹ A message indicates that the watch condition was satisfied.

Note: If

a text view

is not

available,Display Module aSourceblank

display

is

shown, with the

same

message as above

in the message ar

The following programs cannot be added to the ILE debug env

1. ILE programs without debug data

2. OPM programs with non-source debug data only

3. OPM programs without debug data

In the first two cases,

the

stopped

statement

number

is

passed.

I

the stopped

MI instruction is

passed.

The information

is

displayed

a

a blankDisplay Module Source

display as shown below. Instead

of the

line

number, the

statement or

the

instruction

number is

given.

 

 

Chapter 11. Debugging Programs193

Page 217
Image 217
IBM AS/400 manual Example of Setting a Watch Condition