Retrieving a record from a list

If you want to retrieve a record from a list built by a previous LIST request, you must use one of these argument names:
NEXT
Retrieve the next record from the list.
PREV
Retrieve the previous record from the list.
FIRST
Retrieve the first record from the list.
LAST
Retrieve the last record from the list.
A corresponding argument value is not used.

When a LIST is created, HCL Workload Automation for Z sets the first element in the list as the current element. Each time a SELECT request is performed on a list, the current element is updated according to which of the these argument names was used. If you have several lists active, HCL Workload Automation for Z remembers the current element for each of them.

In combination with one of the above arguments, you can use one or more arguments described in Retrieving a record directly from HCL Workload Automation for Z. This is best illustrated with an example:

Figure 1. Example of arguments for processing a list
Action code:   SELECT

Resource code: ADCOM

Argument names:          Values:
                NEXT             -
                STATUS           A
                PRIORITY         9

Assuming a previously successful LIST request has executed for the ADCOM resource, the parameters in this example cause HCL Workload Automation for Z to search the ADCOM list forward from the current element until it finds an element with STATUS A and PRIORITY 9.

This example gives you a mechanism for processing the list you have previously built using a LIST request. After a successful SELECT request, the required record from the list is available in the data area.