Example of Stepping Into a Subprocedure

In this example, you use the F22 (Step Into) to step into the subprocedure Switch, which is in the module DEBUGEX.
  1. Ensure that the Display Module Source display shows the source for DBGEX.
  2. To set an unconditional breakpoint at line 120, which is the last runnable statement before the CALLP operation, type Break 120 and press Enter.
  3. Press F3 (End program) to leave the Display Module Source display.
  4. Call the program. The program stops at breakpoint 119.
  5. Press F22 (Step into). The call statement is run and then the display moves to the subprocedure, as in Figure 1. The first runnable statement of RPGPGM is processed (line 13) and then processing stops.
Figure 1. Stepping into Subprocedure Switch
                             Display Module Source
 Program:   DEBUGEX        Library:   MYLIB          Module:   DBGEX
    141
    142        *=============================================================
    143        * Define the subprocedure Switch.
    144        *=============================================================
    145       P Switch          B
    146       D Switch          PI
    147       D   Parm                         1A
    148        *---------------------------------------------------------
    149        * Define a local variable for debugging purposes.
    150        *---------------------------------------------------------
    151       D Local           S              5A      INZ('aaaaa')
    152
    153       C                   IF        Parm = '1'
    154       C                   EVAL      Parm = '0'
    155       C                   ELSE
 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
 Step completed at line 145.