Before you begin, you must complete Exercise 2.5: Opening a source member for edit and if you were unfamiliar with the editing features of the Remote Systems LPEX Editor then you must completeExercise 2.6: Reviewing Remote System LPEX Editor features.
To make it easier for you, most of the RPG source is already prepared for you. You have already opened the correct source member GETDATA in a previous exercise using the Remote Systems view.
Read through the source. It contains an F spec to access file CUSTOML3, which contains the customer data keyed by customer number. The D specs define the data structure CSTRUC that you pass back to your Web page and the CUSTNOI variable that gets passed from the Web page to this program. As well the FEEDBACK variable is defined as a 20 length character field.
The Entry parameter list is defined as:
The code you have to write here, fetches a customer record by chaining to the file with the CUSTNOI that gets passed into the program.
To edit then create a *PGM object with RPG:
Your coding is complete, so let's create the program.
Be careful not to click the X on the workbench window title bar.
The Create Bound RPG Program (CRTBNDRPG) dialog opens.
After compile, the iSeries Error List view is shown, listing all compile
errors. You may see only information and warning messages which means
your compile was completed and the program object was created.
If you get a message that there are errors in your program, go through the edit compile fix cycle.
Fixing errors
In the error list view, check the errors:
This positions the cursor in the Editor window on the statement that is wrong.
You have edited an RPG source member and created a program object.
Module recap
You have completed Module 2. Creating an RPG program. You have learned how to:
Now that you have created the RPG program, you can continue to Module 4. Creating a Web project.
Skip Module 3. Creating the RPG service program for your Web application (optional) as you don't need to do this set of exercises. |
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.