This documentation space contains information about PATROL Agents when deployed in a TrueSight Operations Management environment. If you are a BMC Helix Operations Management user, see PATROL Agent 22.1 for BMC Helix Operations Management. Open link


Return a list that is the union of individual lists.







PSL list containing elements that shall be united and returned in a single well-defined list Only the first two input lists, list1 and list2, are required; all others are optional.


The union() function returns a PSL list that contains the elements from all listn merged together. Unlike the difference() and intersection() functions, the list returned by the union function is a well-defined set without any duplicates. 

The union( xy ) function is similar to specifying the unique( xy ) function using the string concatenation operator "." to perform union() and the unique() function to remove duplicates. The advantage in using the union() function over the unique() function occurs when x has no terminating new-line character, in which case the use of the "." operator could cause the last element of x and the first element of y to become treated as a single set element. The union() function adds a new line to the end of every nonempty list that is missing one. 

If the return value is not the NULL list, the returned set is always terminated by a new line so that all set elements end with a new-line character.


The following is an example of the union() function:

function main() {
local group1,group2,group3,group4;
group1 = [1,2,3];
group2 = [3,4,5];
group3 = [5,6,7];
group4 = [7,8,9,10];
# or you can do it this way:

Each of the two printf() function statements prints a PSL list containing the integers 1 through 10.

Was this page helpful? Yes No Submitting... Thank you