Exercise 3.10: Filtering lines by type

Before you begin, you must complete Exercise 3.9: Filtering lines by string.

To help you navigate quickly through your ILE RPG source the editor allows you to filter lines based on the line type. Imagine you want to see where all the subroutines are defined in your source.
Editor pop-up menu with Filter sub menu

To filter lines by type:

  1. Right-click in the Editor window with the PAYROLL program.
  2. Click Filter view > Subroutines on the pop-up menu.

    All source lines with BEGSR or ENDSR are displayed allowing you to move quickly and easily to the desired subroutine in your file.
    Subroutine filter in action

  3. Move your cursor to the line with the subroutine declaration CHGCDE (line 444).
  4. Expand the declaration to show all lines in this subroutine.

    Now you could work with the source inside this subroutine.

  5. Right-click in the Editor window and click Show all on the pop-up menu.

You have filter lines in your source by line type and now you are ready to begin Exercise 3.11: Searching multiple files.