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.)

    You will need to open the COBOL source file named PAYROLLC2 to complete this verify step.

    After a moment the verifier will display an iSeries Error List below the Editor window.
    Verifier error list for COBOL 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 LNC1463.

    You are automatically brought back into the Editor window to the line where the error occurred. The error is caused by EMPNO not being uniquely defined. Go to line 302 where EMPNO is defined. The variable EMPNO should be EMPNO OF EMPSEL-I.

  2. Make the change.

    The next error is LNC1326.

  3. Double-click LNC1326. Fix it in the editor.
  4. PRCD should really be PRCDE.

    Make the appropriate change on line 402.

  5. Double-click LNC1329.

    This error is because the array was declared with 4 elements. Go to line 606.

  6. Change the index of the array from 14 to 4.

    The next errors are LNC0407. You can ignore these errors as they are severity 20.

    All severity 30 errors and above are now fixed. You can filter out different severities by using the filter menu.
    Filter for severity levels

  7. Click the arrow in the iSeries Error List title bar.
  8. Click Show Severity on the pop-up menu.
  9. 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.
    COBOL Error list, severity 20 messages

    Everything should be ok. You should see only severity 20 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.