4.3 Compiling Source on the Host

You have found and corrected all the errors in the source using the Program Verifier, you are ready to compile the source on the host system. Whenever you request to compile source within the Editor or CPO, or CODE Designer the CODE Program Generator is activated. The CODE Program Generator allows you to submit host compile commands and specify options for these commands.

Follow these steps:

  1. Select the Actions menu-bar choice from any Editor window.
  2. Select Compile, and then select Prompt.
  3. If you have not saved your source earlier, the Save Before Action window appears. This window lists the source that you have changed during this edit session.
  4. Select Continue to save the modified source on the host system before starting the compile operation. The CODE Program Generator window appears.
  5. Select CRTBNDRPG from the Label list.
  6. Click Options at the bottom of the window to set more compiler options. An ILE RPG -- Create Bound RPG Program Options window appears.
  7. From the Program tab enter a description for your program. Example: Sample Customer Inquiry program
  8. From the Compile tab, select *ALL for all Debugging views and *NONE for Optimize.
  9. Click OK. You are now back at the CODE Program Generator window.
  10. Select Options then Settings.... Ensure that Batch is selected.
  11. Click OK.
  12. Select Submit to submit the compile operation to batch. In CPO, hit the F9 key to switch to the command shell and see your submitted command.
  13. After the compile operation is complete you receive a completion message. Click OK. If there are any errors, the Error List window appears. Only Information messages should appear in the list. You can ignore these Information messages. You need to fix any errors before continuing to the next section.
  14. Close the CODE Program Generator window. You can leave the Editor window up if you wish to fix the errors in the program source that you just compiled.

Running the Program

Now you can run your program.

Follow these steps:

  1. Switch to the command shell (F9) from CPO.
  2. At the AS/400 server prompt, type CALL GUIDES1
  3. Switch to your AS/400 session.
  4. Enter a customer number or press F4 (Prompt).
  5. Press Enter to see the customer information.
  6. Press F12 Cancel. Press F12 Cancel again to exit the application.

Click on to indicate that you've done all the steps.

This completes Exercise 4. You have verified your ILE RPG source using the Program Verifier, worked with the Error List and used the Program Generator to specify options to compile your source.

Next you will move onto develop a Client Application using the GUI Designer.

But before you do, we recommend that you take the Quiz.