Chapter 5. IBM Enterprise Toolkit for AS/400 261
Values of the Operation Code(Input OPTION):
Table 5-2 Flag operation codes
Values of the Return Code(Output OPTION):
Table 5-3 Flag operation codes
5.3.3 Creating a Program Call JavaBean
As shown in Figure 5-4 on page 262, to start the ET/400 Program Call SmartGuide, we
highlight a package and right-click to select Create Program Call. The output is a new class or
JavaBean in the selected package.
5 / PARTPR Part Price 6.2 / packed
6 / PARTDT Part Received Date 10 / date
Sequence/field Description Length/type
Operation code Database operation to execute
S Retrieve a single record for the supplied key
A Retrieve all records
F Fetch next record based on the current position
E End the program
D Delete a single record for the supplied key
U Update a single record for the supplied key with the attribute data. Write a single
record for the supplied key with the attribute data if it doesnt yet exist.
Return code Result description
Y Normal: Operation has succeeded / When operation code was U: Record
Updated
X Normal: Operation has failed / When operation code was U: Record Added
U Unknown operation code has been supplied
262 Building Java Applications for the iSeries Server with VisualAge for Java 3.5
Figure 5-4 ET/400 Create Program Call
As shown in Figure 5-5, the first iSeries Program Call SmartGuide window allows us to
choose whether we want to create a new class or modify an existing class. We choose
Create a new program call class, and click Next.
Figure 5-5 SmartGuide – Create iSeries Program Call (Part 1 of 3)
Chapter 5. IBM Enterprise Toolkit for AS/400 263
Next, we specify the name of the iSeries server, the name of the program, and the library
where the program is found. We can choose the Browse button, and the SmartGuide
interactively retrieves the programs from the specified library. We then select the program that
we want to call. Once we enter the program name to call, we enter the name of the JavaBean
or class that we want to generate and the project and package in which to store it. See
Figure 5-6.
Figure 5-6 SmartGuide – Create iSeries Program Call (Part 2 of 3)
Finally, we need to define the parameters that the iSeries program uses. The SmartGuide
provides choice boxes to insure that we configure the parameters properly. Since this is an
iSeries RPG program, the SmartGuide does not have any way of knowing what the required
parameters are. We need to check the iSeries program to determine this. In Figure 5-7 on
page 264, we show the parameters required for the iSeries RPG Program named DPCXRPG.
264 Building Java Applications for the iSeries Server with VisualAge for Java 3.5
Figure 5-7 SmartGuide – Create iSeries Program Call (Part 3 of 3)
Click the Finish button to generate the new bean. In this case, a bean named DPCXRPG is
generated. A number of fields and methods are generated that allow us to effectively use the
generated bean. The generated fields and methods are shown in Figure 5-8.
Figure 5-8 DPCXRPG generated methods

Get Building Java Applications for the iSeries Server with VisualAge for Java 3.5 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.