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:
- Select the Actions
menu-bar choice from any Editor window.
- Select Compile,
and then select Prompt.
- 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.
- Select Continue
to save the modified source on the host system before starting the compile operation. The CODE
Program Generator window appears.
- Select CRTBNDRPG
from the Label list.
- Click Options at
the bottom of the window to set more compiler options. An ILE RPG -- Create Bound RPG
Program Options window appears.
- From the Program
tab enter a description for your program. Example: Sample Customer Inquiry program
- From the Compile
tab, select *ALL for all Debugging views and *NONE
for Optimize.
- Click OK. You are
now back at the CODE Program Generator window.
- Select Options
then Settings.... Ensure that Batch is selected.
- Click OK.
- 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.
- 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.
- 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:
- Switch to the command shell (F9)
from CPO.
- At the AS/400 server prompt, type CALL
GUIDES1
- Switch to your AS/400 session.
- Enter a customer number or press F4
(Prompt).
- Press Enter to
see the customer information.
- 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.