IBM AS/400 manual Stepping Through the Program Object

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 221
Image 221
Manual background

Stepping Through the Program Object

Example

of

Stepping

Into

an

OPM

Program

Using

F22

 

 

 

In this example, you use

the

F22

(Step

Into) to step

into the OPM

RPGPGM

from

the

program

DEBUGEX.

 

 

 

 

 

1. Ensure

that

the Display Module Source display shows the source f

2. To

set

an

unconditional

breakpoint

at

line 102,

which

is the last

ment

before

the

CALL

operation,Break type102 and press

Enter.

 

3. Press F3 (End program) to leave the Display Module Source display.

4. Call the program. The program stops at breakpoint 102, as shown in

ˆ

 

 

Display Module

Source

 

Program:

DEBUGEX

Library:

MYLIB

Module:

DBGEX

98* Fld1a is an overlay field of Fld1. Since Fld1 is initialized

99* to 'ABCDE', the value of Fld1a(1) is 'A'. After the

100* following MOVE operation, the value of Fld1a(1) is '1'.

101*---------------------------------------------------------------

102

C

MOVE

'1'

Fld1a(1)

103

 

 

 

 

104*---------------------------------------------------------------

105* Call the program RPGPGM, which is a separate program obje￿ct.

106*---------------------------------------------------------------

107

C

Plist1

PLIST

 

 

108

C

 

PARM

 

PARM1

109

C

 

CALL

'RPGPGM'

Plist1

110

 

 

 

 

 

111*---------------------------------------------------------------

112* Call c_proc, which imports ExportFld from the main proced￿ure.

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

Breakpoint

at line 102.

 

 

 

 

˜

Figure 93. Display Module Source display of DBGEX Before Stepping Into RPGPGM

5. Press F22 (Step into). One statement of the program runs, and then Display Module Source display of RPGPGM is shown, as in Figure 94 on page 198.

In

this

case,

the first

runnable

statement

of RPGPGM is processed

and

then

the program

stops.

 

 

Note:

You

cannot

specify the number of statements to step through

 

use

F22.

Pressing

F22

performs

a single

step.

Chapter 11. Debugging Programs197

Page 221
Image 221
IBM AS/400 manual Stepping Through the Program Object