Exercise 4.1: Verifying the source

Now you get to play with one of the most powerful and unique features of the Remote System Explorer - the Program Verifier. Before you compile your code on an iSeries, you can make certain that there are no errors by invoking the Program Verifier. The verifier checks for semantic (compile) errors on your workstation so that you can guarantee a clean compile on the iSeries. Think of the host cycles you'll save. It is especially handy when you are writing code but you are disconnected from an iSeries. You can do this because Remote System Explorer ported the parsing and checking code from the iSeries system compilers to the workstation. The iSeries Error List view lists the errors that are found and their severity, inserts the error messages directly into the source and helps you to navigate between the errors.

To invoke the verifier:

  1. Click Source > Verify from the workbench menu. (Similarly, you can also use the pop-up menu for the source member in the Remote Systems View or the Verify tool button -- you need the source in the editor for the button to appear.)

    After a moment the verifier will display an iSeries Error List below the Editor window.
    Verifier error list for RPG source

    The error list shows you:

Fixing errors

Next you will fix the errors in your source.

To fix an error in your source go to the error list:

  1. Double-click the error RNF7030.

    You are automatically brought back into the Editor window to the line where the error occurred. The error on line 365 is a typo. The variable EMES should be EMESS. One good way of finding the correct name is the content assist.
    Content Assist

    Note:
    The Outline view must be populated to use content assist.
  2. Select the misspelled variable and press CRTL+spacebar.

    If the variable starts correctly the selection presented contains the correct name.

  3. Double-click the variable EMESS in the list to correct the variable name.

    Another way to find the variable name is to use the Outline view and see what variables are declared.
    Outline view with expanded fields

    The next error is a RNF7030 as well.

  4. Double-click RNF7030. Fix it in the editor.
  5. RSNTAX should really be RSNTAG.

    Make the appropriate change.

  6. Go to the next error RNF5184.

    The next error is actually RNF7018 but it is related to the one you just fixed and can be ignored. It shows the same line number, which is an indication that both errors are related.

  7. Double-click RNF5184.
  8. Fix this by replacing the 2 with a 1.

    Error RNF7515 is related to the first error you fixed. It has the same line number. You can ignore it. The only serious remaining error is RFN5178. This error is caused by a missing ENDSR.

    Note:
    The verifier could not determine where the ENDSR is missing so the line number reported is 1, for this reason you can't just double-click on the error message. You need to investigate where the missing statement belongs. You can use the Indent view to determine where the ENDSR is missing.
  9. Move to line 398 in the editor.
    ENDSR commented out by mistake
  10. Remove the asterisk (*) from the C-spec.

    You can use the Tab key to quickly move to the appropriate column.

    All the non-informational errors are now fixed.

    You can filter out messages according to these severities by using the filter menu.
    Filter for severity levels

  11. Click the arrow in the iSeries Error List title bar.
  12. Click Show Severity on the pop-up menu.
  13. Clear the severities you don't want to see in the list (Warning for example).

Saving the source member

Now before you loose any of your changes, it's a good idea to save them. Make sure the member is selected. You then verify the source again to make sure that all the errors are fixed.

You can save the member using one of these ways:

  1. Click File > Save from the workbench menu.
  2. Click the Save icon save icon in the workbench toolbar.
  3. Press Ctrl+S.

    Changes are uploaded to the iSeries.

  4. Verify your source again.
    RPG Error list, severity 0 messages

    Everything should be ok. You should see only severity 0 messages. You are ready to compile the program.

You have verified your source and fixed any errors and now you are ready to begin Exercise 4.2: Compiling source remotely.