Exercise 2.2: Editing local source members in disconnected mode

Before you begin, you must complete Exercise 2.1: Making source available offline.

Editing local source members under iSeries projects is the same as editing remote source members in the Remote Systems Explorer. The LPEX editor can be launched on any local member and the same functionality is available, such as the Outline view, prompter and the content assist feature.

There is one major difference though when editing source members using the LPEX editor in the Remote System Explorer perspective as opposed to using the LPEX editor in the iSeries Project Perspective. When a source member is opened in LPEX in the Remote System Explorer perspective, it is locked, and it cannot be modified on the host while the local edit session is active. Any code changes that you make locally will be saved to the host when the Save action is performed in the LPEX editor.

On the other hand, when a member is opened in the LPEX editor in the iSeries Projects perspective, the member is not locked on the host. It can be modified by anyone with enough authority to the object. If you do a Refresh on the iSeries Project, a double sided red arrow will indicate that the member has been modified on the host. When you push changes back to the host, (something you will do when you are connected again), you will be warned that you will be overwriting remote changes, and you are given the chance to cancel the operation.

Now let's edit the member PAYROLLG that you already have open in the editor.

To edit PAYROLLG:

  1. In the PAYROLLG Editor window move the cursor to line 211 which contains EXSR ACDESR.
  2. Append an X to the EXSR op-code to make it EXSRX.
  3. Click File > Save from the workbench menu to save this change.

    You will fix this error later.

Displaying an outline of an ILE RPG member

The Outline view acts as an excellent resource when you want to edit RPG and COBOL source in the Remote Systems LPEX editor. The Outline view displays a structural outline of items defined in the source that you currently have open in the Remote Systems LPEX editor window. With the editor active, you can expand the file structure in the Outline view, and click various elements in the view to jump to that location in the source itself.

To see an Outline view of your RPG source:

  1. Click the PAYROLLG tab in the editor and click Refresh on the Outline view toolbar.

    The Outline view contains your source program in a tree view without the lines containing logic.
    Outline view with file and record format expanded

    Now you want to see more details of your source member.

  2. Expand Files.
  3. Expand the MSTDSP workstation file.
  4. Expand the EMPSEL record format.
  5. Double-click on any of the entries in the Outline view.

    This will position the source editor accordingly.
    Click the tab to give focus to the edit session

Opening a DDS member

You can also edit DDS members locally from the iSeries Projects Navigator.

To open a DDS file member:

  1. In the iSeries Project Navigator, expand QDDSSRC, if it is not already expanded.
    Edit using Code Designer
  2. Right-click MSTDSP member and click Open With.

    As in the Remote System Explorer perspective, you now have the options to open the Remote Systems LPEX Editor or other editors. CODE Designer is not registered as an external editor for display files, but you can change that by manually adding it through the preference page, and it will then appear in the Open With menu. To do this:

    1. Select Window > Preferences from the main menu.
    2. Expand Workbench. Select File Associations.
    3. Select *dspf from File types.
    4. Click Add next to the Associated editors list view.
    5. Choose External Programs and then browse to the location where CODE Designer (codedsu.exe), is installed. Click Open. Click OK.

      Next you will add the Code Editor.

    6. Click Add next to the Associated editors list view.
    7. Choose External Programs and then browse to the location where CODE Editor (codeedit.exe), is installed. Click Open. Click OK.
    8. Click OK to close the Preferences window.

      Now, if you right click MSTDSP member and click Open With you will see the codedsu and codeedit added to the pop-up menu.

You have edited a local source member under an iSeries Project, viewed an outline of the local RPG source and opened a local DDS member for edit from the iSeries Project Navigator and now you are ready to begin Exercise 2.3: Verifying RPG source in disconnected mode.