Chapter 2. Integrating HATS with business applications 111
b. In the Define Screen Recognition Criteria window (Figure 2-43), using
your mouse pointer, select the Find Data in Query Manager Table text
and click Next.
Figure 2-43 Defining a screen
c. On the following panel, click Next again and then click Finish.
112 Using IBM WebSphere Host Access Transformation Services V5
d. In the Add Prompt Action window (Figure 2-44), notice the Handle Macro
Prompt option. You have three different options:
Show handler allows you to specify which JSP file to render the
default transformation. A default macro handler is shipped with HATS,
and it is named default.jsp.
Set prompt to string is used when you know what value should be
returned from a prompt. You can enter that string in the String field.
Set prompt to global variable is used when you want the value of the
prompt to be provided by a global variable. Enter a name for the global
variable in the name field or select an existing variable using the
drop-down menu.
If you have a User List in your project, use Set prompt to property
from User List to set the user and password. Using this feature, the
values for User and Password are completed by HATS and you need
only to press Enter to continue with your application. We use a
combination of a macro and a User List in 2.4.2, “Using a User List in a
VT transformation” on page 158.
Complete with the name of the variable. In this example, for Name, type
productid. Leave the default values and click OK.
Chapter 2. Integrating HATS with business applications 113
Figure 2-44 Macro prompt action
12.In the Prompt window (Figure 2-45), enter a real value. In this case, we type
FI-SW-01. Then click OK.
Figure 2-45 Macro value pop-up
13.Press Enter.
114 Using IBM WebSphere Host Access Transformation Services V5
14.On the Display Report screen (Figure 2-46), you see the result of the
SELECT request. We have completed the macro. Click the Stop Macro
Figure 2-46 Macro display report
Chapter 2. Integrating HATS with business applications 115
15.Save the macro. Click the Save Macro button as shown in Figure 2-47.
Figure 2-47 Macro saving
Testing the macro
After you finish recording the macro, you can test the entire macro using the Play
macro button. Remember that we started with the record on the AS/400 Main
Menu screen.
1. Return to AS/400 Main Menu screen. Depending on what screen you are on,
press PF12 or PF3.
2. When you reach the AS/400 Main Menu screen, click the Play Macro button
as shown in Figure 2-48.
Figure 2-48 Macro play
3. The Supply Prompt Values window (Figure 2-49) asks you to enter the
productid value that the macro will use in the Add Prompt Action created in
the previous section.
Type a valid value for your database (in this case FI-SW-01) and click OK.
Figure 2-49 Macro input
If the macro completes successfully, you see the results page as shown in
Figure 2-46.

Get Using IBM WebSphere Host Access Transformation Services V5 now with the O’Reilly learning platform.

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