ASPL Manual v 1.00
© 2024 by SetSphere.COM


13. 23
   split splits set variables into set variables

 

logo

split a1 [a2 .. aN] into trg1 trg2 ..       where a1 [a2 .. aN] trg1 trg2 .. are set variables

the number of the target set variables must match the number of the labeled groups in a1 [a2 .. aN]

split a1 [a2 .. aN] into trg*       where a1 [a2 .. aN] trg* are set variables

using the wildcard in trg* is possible if a1 a2 .. have regulated label names (see example 2 and 3 below)

split  setoid  1*t          ins:H_H_H  ous:H_H_H

●  Operator split splits set variables into set variables

Use the split operator to split a set variable into its consituent labeling group. A set variable whose labeled groups are formed by a word suffixed by digit numbers can be split using a target name followed by a wildcard (see example 2 below). For instance, this is useful to split group labels of set variables representing UNIX processes (see example 3).

 

split EXAMPLE1

The following example shows how to use split operator.

 

split OPERATION1

aspl WS1
    (start ASPL loading sample workspace WS1)

①  aspl> a123 = f& a1 a2 a3
    (assign a123 to the intersection of a1 a2 a3)

②  aspl> split a123 into t1 t2
    (this split will fail since you need to specify three target set variables)

③  aspl> split a123 into t1 t2 t3
    (this splits a123 into t1 t2 t3 successfully)

④  aspl> v

 

split EXAMPLE2
Use the split operator to split a variable into multiple variables according to their named group label. If the group label names are homogeneously named according to a predefined suffix then you can split them according to that suffix.

 

split OPERATION2

aspl WS1
    (start ASPL loading sample workspace WS1)

①  aspl> a1234 = gU a1 a2 a3 a4
    (a1234 is assigned a1 a2 a3 a4)

②  aspl> v
    (print symbol table, see colum Lvr showing the group label regulated names)

③  aspl> split a1234 into t*
    (split a1234 into t* that will create t1 t2 t3 t4)

④  aspl> v
    (print symbol table)

 

split EXAMPLE3
Use the split operator to split a variable into multiple variables according to their named group label. If the group label names are homogeneously named according to a predefined suffix then you can split them according to that suffix. In this example we will harvest the processes started by a WebSphere startup script then split them into variables each named with the process label. Refer to workspace ENV123.

 

split OPERATION3

aspl ENV123
    (start ASPL loading sample workspace ENV123)

①  aspl> wa3 = ggreapenvbypid(grp1,wa1,program,/opt/IBM/WebSphere/AppServer/bin/startServer.sh server1,onlychanged,1)
    (harvest the processes started by WebSphere.sh and assign them to wa3)

②  aspl> v

③  aspl> split wa3 into p*
    (split wa3 into it group of processes assign them to p*)

④  aspl> v

⑤  aspl> sim p17016 p17018 p17019
    (display similarity between the processes)

⑥  aspl> fU p17016 p17018 p17019
    (display the processes union)

⑦  aspl> f& p17016 p17018 p17019
    (display the processes intersection)

⑧  aspl> f\ p17018 p17016
    (display difference between processes p17018 p17016)

⑨  aspl> f\ p17016 p17018
    (display difference between processes p17016 p17018)