SORT_LISTS

LANSA Composer

SORT_LISTS

This activity will sort one or more variable lists in "parallel" into the order of the values in the list specified by the SORTLIST1 parameter.

In the simplest case, where you want to sort one list, simply specify the required variable list on the SORTLIST1 parameter.

You might specify more than one list in cases where you have variable lists that are linked.  For example, you have two variable lists ORDERS and CUSTOMERS that contain an order number and customer number respectively for a list of ORDERS.  For every entry in ORDERS, there is also an entry in CUSTOMERS that contains the customer number for the corresponding order.

To sort the two lists in "parallel" into the sequence of the order numbers, you could specify ORDERS as the list for the SORTLIST1 parameter and CUSTOMERS as the list for the SORTLIST2 parameter.

If you specify more than one list, all the lists must have the same number of list items.  Otherwise, the activity will end in error.

NOTE:  This activity imposes a maximum number of list items that can be sorted.  If the variable list contains more than the maximum, the activity will end in error.  The maximum is usually 9,999.  However, using variable lists of this extent is generally NOT recommended in the context of this activity or any other aspect of LANSA Composer variable list processing.

INPUT Parameters:

SEQUENCE : Optional

This parameter specifies whether the variable list(s) should be sorted in ascending (*ASCEND) or descending (*DESCEND) order of the values in the list specified by the SORTLIST1 parameter.

INPUT and Output Parameters:

SORTLIST1 : Required

Specifies the first variable list to be sorted.  If more than one list is specified, it is the values in THIS list that  are used to sort ALL the lists in parallel.  This parameter must be specified.

SORTLIST2SORTLIST3
SORTLIST4

SORTLIST5
: Optional

You may specify up to four additional variable lists to be sorted in "parallel".  If you use these parameters you must specify them contiguously - LANSA Composer will stop looking after the first unused parameter.  Each list specified here must have exactly the same number of list items as the list specified in the SORTLIST1 parameter - otherwise the activity will end in error.