In this topic you will record application screens, create
a loop to handle the multiple pages of the Inquire Catalog application
screen, add Extract actions to extract the data, and end the flow
recording.
Note: The loop recording that you create in
this topic is an example of a recording of a multipage list. The interior
of the loop is a single application screen that displays one page
of a multipage list (see Recording a multipage list as a loop).
To record the flow information:
Verify that flow recording is in progress and that the CICS® example catalog application
is displaying the Main Menu screen:
- Verify that the Stop Flow Recording icon
is
displayed on the host editor toolbar. This indicates that flow recording
is in progress.
- Verify that the title line of the application screen reads: CICS
EXAMPLE CATALOG OPERATION - Main Menu.
On the Main Menu application screen, in the Action input
field, type 1 and press the Enter key. The
Inquire Catalog application screen is displayed.
Steps 4 through 10 describe how to record the application screens
in the multipage catalog as a loop. Table 1 provides
an overview of the actions you will take in these steps:
On the host editor's toolbar, click Begin
Loop
to indicate that this screen is the first
application screen of the first iteration of a loop (see Controls for recording a loop).
The icon changes
to End Loop
to remind you that you have now entered
the stage of loop recording in which you are seeking
to navigate all the way through one iteration of the loop and back
to the Begin Loop application screen.
Create Extract actions to extract the item numbers
from the fields in the
Item column of the currently
displayed application screen.
This is the column
at the left side of the screen with contents 0010 on
the first row, 0020 on the second row, and
so on. (The currently displayed application screen is still the
first page of the Inquire Catalog application screen.)
Note: You will
need to create the Extract actions only once. The Extract actions
that you create for the first page of the Inquire Catalog application
screen can be reused for all the other pages of the Inquire Catalog
application screen, because the field names and field locations in
the Item column remain the same from page to
page.
- Create the Extract action for the first field in the Item column (the field containing 0010):
- Click Extract Data from Screen
.
- The Select Variable window opens, prompting
you to select a variable to hold the text from the Extract action.
- The Select Variable window displays all
the variables in the variable message v_CheckItemAvailability that
could be used for an Extract action.
- So far the only such variable is variable0,
which is the loop variable for the While loop. This loop variable
was created automatically when you selected Begin Loop.
The variable was created automatically because you selected the check
box Do not prompt for variables when generating variable
mapping in the Preferences (see A. Prepare for the flow recording).
Note: Why
then does the Select Variable window open here
to prompt you to select a variable for the Extract action? If a loop
is in progress, as it is here, then the Select Variable window
opens even if the check box Do not prompt for variables
when generating variable mapping was selected.
- In the Select Variable window create variables
for all the Extract actions that are needed for this application screen:
- At the moment you need only one Extract variable for the current
Extract action. However, it is easier to create the Extract variables
for all the Extract actions needed for this application screen at
once.
- To create the first Extract variable:
- Click Add new variable. The Add
New Variable window opens.
- Type INQ1-ITEMREF.
- Click OK.
- The Select Variable window should still
be open. Now create variables for the remaining Extract actions needed
for this application screen, following the same steps as before. There
are 15 Extract variables in all, but these are the only Extract actions
that you must create for this tutorial. Table 2 shows the
names of all the Extract variables:
- Now that you have created all the Extract variables, it is time
to select the variable for the first Extract action. In the Select
Variable window:
- Click INQ1-ITEMREF.
- Clear the check box Extract data every iteration of
this loop.
Important: You must clear this
check box for the tutorial to work correctly.
- Clear the check box Extract data into variable.
- Click OK.
- You are still working on the first Extract action. Now it is time
to select the field to be read by the first Extract action. Move the
mouse pointer to the first item number in the column. The characters
in the field are surrounded with red square brackets ( [ ] ). For
example, in Figure 1 the
field containing the characters "0010" is surrounded
with red square brackets, like this: [0010 ].
- Now click the field that is surrounded by the red square brackets.
The host editor performs the following actions:
- It anchors the red brackets to mark the selected field.
- It creates an Extract action to read the contents of the selected
field.
- It sets INQ1-ITEMREF as the variable for the Extract
action.
Note: Creating an Extract action does not save the current contents
of the field (0010, 0020, and so
on. Rather, creating an Extract action saves the location of the field,
so that at runtime the Extract action can read the contents of the
field, whatever they may be.
- Repeat the steps above to create the remaining fourteen Extract
actions for this screen (use variable INQ2-ITEMREF for the field containing 0020,
variable INQ3-ITEMREF for the field containing 0030,
and so on). For each Extract action:
- Click Extract Data from Screen
. The Select Variable window opens.
- In the Select Variable window:
- Select the Extract variable that you want to use (see Table 2).
- Clear the check box Extract data every iteration of
this loop.
- Clear the check box Extract data into variable.
- Click OK.
- In the session area click the field that you want the Extract
action to read text from. The red square brackets should be anchored
to the field that you select.
Press F8 to navigate to the next application
screen.
The application screen changes to show the second page
of the list of items.
In this stage of the loop recording you
are seeking to navigate all the way through one
iteration of the loop and back to the Begin Loop application
screen:
In this recorded loop a single iteration consists of only one application
screen (see Recording a multipage list as a loop). Therefore
by pressing F8 once in this step you have navigated entirely through
one iteration of the loop and have now returned to the Begin
Loop application screen.
You might have noticed that although some of the content of
the application screen changed when you pressed F8 above (the next
sequential items in the list are now displayed) nevertheless the application
screen is still recognized as Dfh0xs2.Exinq_Exinqc in
the information area.
Because you navigated away from Begin Loop screen
(by pressing F8) and you have now returned to the Begin
Loop screen, you have completed one iteration of the loop.
On the host editor's toolbar, click End
Loop
to indicate that you have completed one
iteration of the loop and have arrived back at the Begin
Loop screen.
The host
editor does the following:
- It displays the Exit Loop icon
to indicate
that the next task is to identify the Exit Loop screen (see Controls for recording a loop).
- It disables the Stop Flow Recording
icon
to indicate that flow recording is temporarily suspended (see Recording the loop).
Press F8 to page forward through the application
screens that sequentially show all the available items in the list.
Keep pressing F8 (one or two presses might
be enough) until the text END OF DATA appears
on line 23 of the session area.
The recognized
screen description is Dfh0xs2.Exinqc_EndPage.
On the host editor's toolbar click Exit
Loop
to indicate that the current application screen (Dfh0xs2.Exinqc_EndPage)
is the Exit Loop screen. The Exit
Loop screen is the first application screen that occurs
after the loop has ended (see Controls for recording a loop).
The Exit
Flow Loop window opens.
In the
Exit Flow Loop window:
- The upper pane lists the names of the screen descriptions
(these are also the names of the corresponding Invoke screen operation
nodes) that the loop can exit from.
- Select the check box beside Dfh0xs2.Exinqc_Exinqc.
By selecting this check box you identify this application screen as
a valid exit-from screen for the recorded loop (see Exit-from screens).
- Click OK.
Press F12. The CICS example
catalog application returns to the Main Menu screen.
On the host editor toolbar, click the Stop Flow
Recording icon
to terminate flow recording. Flow recording
ends.
On the host editor toolbar, click the Save Flow icon
. The
host editor saves the flow.
Note: The new flow, CheckItemAvailabilty.seqflow,
is added to the Flows folder.
Log off and close the host editor.