ASPL User Guide v 1.00
© 2025 Bassem W. Jamaleddine
15. 1Interrogating a Set Variable
Interrogate
? setvar where setvar is a set variable
Really interrogate
?? setvar where setvar is a set variable
Interrogating a Set Variable
You can interrogate a set variable by using ? operator and ASPL will reiterate the process that sourced this variable; then ASPL will compare the previous data to the sourced data: if there is any change in the sourced data then ASPL updates the variable with the newly sourced data. When a variable is being updated, its old data is being archived and you can use the @ operator to view a variable and its archived data.
Each set variable represents a dataset that originated from some kind of source: a function, a setadic statement, a grouping expression, etc. The source is maintained in each variable, and you can view it by displaying the symbol table. In this example, we load the workspace RANDONEBIT and display the symbol table:
01:20 root@mm01: ~ # aspl -wsname RANDONEBIT -groupingclass BITGROUP ______ ____ ______ __ / __ / / ___\ / __ / / / / /_/ / \ \ / ____/ / / / __ / __ \ / / / / / / / / / __ / / / / /____ /_/ /_/ \___/ /_/ /______/ STARTING ASPL SESSION WITH WORKSPACE: RANDONEBIT NAMED GROUP: BITGROUP last saved 2024-02-13 01:09:15.855164 1:21:19 root@mm01 /root aspl:1 > dm 1 DISPLAY MODE SET TO 1 1:21:25 root@mm01 /root aspl:2 > v VARIABLES TYPE 1 vname |card |xpC |Lgn |Src ------------|----------|------------|--------------------------------|------------------------------------ v1 |#31/1 |ggfunc |g1 |ggbitsubgS(gstart,1,gcount,1,dmin,.. v2 |#49/1 |ggfunc |g2 |ggbitsubgS(gstart,2,gcount,1,dmin,.. v3 |#28/1 |ggfunc |g3 |ggbitsubgS(gstart,3,gcount,1,dmin,..Notice the Src column showing the source function that created the variable. The variables have been created by sourcing the function ggbitsubgS() and you can view this function by typing ggls ggbitsubgS() at the ASPL prompt. This function creates random number of groups, subgroups, and elements. Calling this function at different time will result with different datasets. So let's see how to interrogate the set variable.
The choice for the symbol ? is adopted in ASPL as the interrogation operator.
You can interrogate a set variable by using ? operator and ASPL will reiterate the process that sourced this variable; then ASPL will compare the previous data to the sourced data: if there is any change in the sourced data then ASPL updates the variable with the newly sourced data. When a variable is being updated, its old data is being archived and you can use the @ operator to view a variable and its archived data.
Interrogating a Set Variable EXAMPLE1The following example shows how to interrogate a set variable in the sample workspace RANDONEBIT. We start ASPL by loading the sample workspace RANDONEBIT, we interrogate the set variable v1, then issue the labinated operation ,gU on the set variable and its archived variable.
Interrogating a Set Variable OPERATION1# aspl RANDONEBIT
(start ASPL loading the sample workspace RANDONEBIT)
① aspl>
v sorted
(display the symbol table showing the archived variables)
② aspl>
? v1
(interrogate the v1 set variable updating it)
② aspl>
@ v1
(print v1 and its archived historical data)
② aspl>
? v1
(interrogate the v1 set variable updating it)
② aspl>
@ v1
(print v1 and its archived historical data)
③ aspl>
v sorted
(display the symbol table showing the archived variables)
④ aspl>
,gU v1 v1@1
(get groups union of v1 and its archived v1@1)
Interrogating a Set Variable EXAMPLE2The following example shows how to interrogate a set variable and its dependencies in the sample workspace RANDONEBIT. We start ASPL by loading the sample workspace RANDONEBIT, we create a set variable that depends on two other variables, then we really interrogate the set variable.
Interrogating a Set Variable OPERATION2# aspl RANDONEBIT
(start ASPL loading the sample workspace RANDONEBIT)
① aspl>
v sorted
(display the symbol table showing the archived variables)
② aspl>
v12 = gU v1 v2
(v12 is assigned to gU v1 v2, hence it depends on v1 and v2)
② aspl>
? v12
(interrogate the v12 set variable)
② aspl>
@ v12
(print v12 and its archived historical data)
② aspl>
?? v12
(really interrogate the v12 and its dependencies)
② aspl>
@ v12
(print v12 and its archived historical data)
③ aspl>
v sorted
(display the symbol table showing the archived variables)
④ aspl>
,gU v12 v12@1
(get groups union of v12 and its archived v12@1)
④ aspl>
@sim v12
(display the similarity between v12 and its archived data)
Interrogating a Set Variable EXAMPLE3The following example shows how to find the union of subdirectories and files found in a directory and its archive. We start ASPL by loading the sample workspace WS1, we make some changes in the source directory represented by set variable a1, then we interrogate the set variable a1 and issue the labinated operation ,gU on the set variables.
Interrogating a Set Variable OPERATION3# aspl WS1
(start ASPL loading the sample workspace WS1)
① aspl>
v sorted
(display the symbol table showing the archived variables)
② aspl>
? a1
(interrogate the a1 set variable updating it)
③ aspl>
v sorted
(display the symbol table showing the archived variables)
④ aspl>
,gU a1 a1@1
(get groups union of a1 and its archived a1@1)